Department-based web site in which users can only edit content in their own department What would be the steps to build a web site with different departments in which the users with edit permission can only edit content in their own department? Content types would be shared, e.g. the "page" content type should be available to all of them.

I've read this can be accomplished with PURL + spaces, but I am not sure this is still the best option, as most posts about it are from a few years ago.
You should look at the Organic Groups (OG) modules.

With OG, departments (i.e. "groups") is set up and managed by means of the graphical user interface.  It simply provides a way to delimit a department in terms of content and members.  Unlike the Spaces module, there is no total separation between departments.  OG modules presents an evironment where departments appear to exist side by side within a single website. In other words, the groups are non-hierarchical, leverage the same theme and share common modules, etc.

Within this framwork, OG can provide multiple levels of privacy and membership.

It allows one to create content types that can associate any number of nodes to a group node. Then, developers and users can create pages that only display content intended for that particular department.

Note, however, that OG does not provide a base URL for a department namespace (e.g. http://example.com/startrek/ for a department named "Startrek".)  If you want this, the convention approach has been to install OG + Spaces + PURL to get this.

However, this article suggests an alternative approach building on a sandbox module named OG Token.  I haven't tested this tho'.  There is also another bridge module, named OG Purl that may do this for you.

Alternate, lightweight solution: If you can relax the requirement that all departments shall have access to the same content types, you can implement this with the core alone (i.e. without any external module), just using Drupal's built-in ability to clone content types and built-in role based access.

For instance, let say you want to have a department named "Startrek" (for fans of the classic TV-series).  Clone the Article content type and call the clone "StartrekArticle".  Now create a role named "StartrekEditor". 

Navigate to Administration » People » Permissions and scroll down do the Node section.  Grant the role StartrekEditor the following permissions:


StartrekArticle: Create new content
StartrekArticle: Edit own content
StartrekArticle: Edit any content
StartrekArticle: Delete own content
StartrekArticle: Delete any content


Now, just give any user that is going to be editor in the Startrek department the role StartrekEditor.

Also note creating department-specific content types have no impact on the user's ability to view content.  The Drupal default is that any user may view any content, and users will not even be aware of the fact that they're viewing content in different departments that differ by name only.

To have a base URL for a department namespace using this lightweight solution, you still need to install PURL, but you will not have to deal with heavyweight modules such as OG + Spaces.