I want to have a user with a role of, say, ceo, is related to a company. A ceo has certain access. Director role reports to THEIR related ceo. manager role reports to THEIR related director,...

When a user logs in, the system needs to understand the user's role and WHICH company they belong to.

How would you do this?

Many thanks!!

Comments

zirvap’s picture

Well, it depends on what the system is supposed to do with the information about the user's role and company. I suggest you take a look at http://drupal.org/project/og, it's got a lot of functionality for handling groups and group specific permissions to post and read stuff.

webdev2’s picture

thanks, I will but I need to control which companies start a group and how they add members. I don't want anyone to join any group. Only approved.invited people can join any group.

I'll check it out

jeffreyd’s picture

OG's do not nest one within another. So OG's will allow you to group people (loosely, as group members can choose when to leave a group), but one OG cannot join another, so you have only one level of an organization. You can't build hierarchical relationships of groups.

You might need to create an elaborate set of roles to describe all the types of users, then mis-appropriate the taxonomy and taxonomy access modules to control access to pages based on roles you assign to users.

I am also looking for an elegant way to map real-world rights, roles, and complex associations into Drupal access permissions without hacking existing modules to death.

webdev2’s picture

yeah, me too. I've done this on my own (PHP/MySQL) relatively easily but making it work in Drupal does not seem to be a practical reality.

Thanks.

zirvap’s picture

Have you tried http://drupal.org/project/og_subgroups? I haven't used it myself, but from the description it appears to do what you want.

webdev2’s picture

thanks, I'll take a look