1

I looked at the group module. Defining permissions based on user and entity memberships would suit my needs very well, but sometimes I would need a combination of various group memberships to define if a user is able to see an article.

Example:

There are two group types: site and department.

The user is a member of the group "Paris" and the department "sales". The article is a member of both groups as well.

The user should only see articles which are member of BOTH groups. He should not see the articles which are member of the group "Paris", but not member of the group "sales".

Is this possible?

0

1 Answer 1

1

I think your understanding of membership is not correct. So first a clarification:

  • Users can be member of one or more groups.
  • Content, such as articles, can be assigned (= belong to) a single group.

With that in mind, you may want to try an approach like so:

  • Create a group type of, say, Regional departments (a single group type should be enough for your case).

  • Create various groups, of group type Regional departments, named something like so (with names that should be self explaining):

    • Paris - Sales
    • Paris - Support
    • Paris - Accounting
    • Paris - R&D
    • Paris
    • Nice - Sales
    • Nice - Support
    • Nice - HRM
    • Nice
  • For any user, create group memberships depending on their region (Paris or Nice), and depending on their (what you call) departement (Sales, Support, etc). Special case: for each user, also create a group memberships depending on their region (Paris or Nice).

  • Whenever you create content (articles), you assign it to the appropriate group. Special case: if you assign it to (e.g) group Nice, then any Nice departement has access to it.

That's really it. But on top of that, you can optionally:

  • Change to which group an article belongs (e.g from 'Paris - Sales' to 'Nice - Sales', eg when sales territories get reorganized).
  • Grant or revoke access for selected user(s) to specific content (articles), simply by changing their group memberships (e.g if a user gets tranfered to another departement).
1
  • Thank you for the detailed answer! I will have to calculate if this is a possible solution for my task because it could lead to a very large amount of groups, but you gave me a better understanding of the group module.
    – NedRise
    Apr 25, 2019 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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