Kay Pale
Kay Pale

Reputation: 6569

Dynamic forum permissions in Drupal

My users access Drupal through SSO and everytime the server authorizes them, it returns a set of permissions (groups/roles), according to which I need to dynamically set the User's forum permissions.

So for example if a User logs in and the SSO says that he has enrolled in a course, I need to give him specific permissions for that course's forum.

Obviously I need a custom module for that, but it's a little hard to start.

I'm thinking of using the ACL module's API, but I can find any documentation or tutorial online. Is there any?

Is there a better way to get around this?

I'd appreciate any help :)


(note: I know there are modules with GUI that have similar functionality but I need to do it programmatically)

Upvotes: 2

Views: 550

Answers (3)

Andrew Sledge
Andrew Sledge

Reputation: 10351

We just put something exactly like this into place - we used the Rules module (with the User logged in trigger), checking the LDAP groups that the user is enrolled in, and assigned the role accordingly.

Upvotes: 1

troynt
troynt

Reputation: 1912

Create a hook_user function ( see http://api.drupal.org/api/function/hook_user ) in your module.

Then using http://drupal.org/project/permissions_api set the appropriate permissions on the user.

Upvotes: 0

Erik Ahlswede
Erik Ahlswede

Reputation: 2155

Check out Forum Access. It can restrict users based on their roles.

You could have your roles be something like "CSC221 Student". If a user has this role, they will be able to access the CSC221 forum.

Upvotes: 0

Related Questions