0

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.

closed as primarily opinion-based by Mołot, Bala, rooby, 4life, Anil Sagar Mar 20 '14 at 5:23

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • You say that "users should only be able to edit content in their own department". What about viewing content? Shall users also be restricted to only viewing content in their own department? – Free Radical Mar 14 '14 at 7:56
  • 1
    Have you played with organic-groups? – Mołot Mar 14 '14 at 9:00
  • @GisleHannemyr I referred only to the editors. Users with edit permissions can only edit content in their own department. All content can be viewed by all users. I've corrected this. – Steven Mar 14 '14 at 9:06
0

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.

  • Sounds good. A last detail: Do OG allow to have a base URL for each department like www.example.com/department-name/page-url? – Steven Mar 14 '14 at 9:16
  • @Steven: No, OG does not provide a base URL out of the box. I've expanded my answer with some of the possible solutions. – Free Radical Mar 14 '14 at 9:43
  • Sounds good. I cannot follow the lightweight alternative as I need over 20 departments. I will check OG Purl and the others suggested. – Steven Mar 14 '14 at 14:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.