Closed (fixed)
Project:
Domain
Version:
6.x-2.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2010 at 13:55 UTC
Updated:
10 Feb 2010 at 15:01 UTC
Hi,
I have several domains. Depending on the current domain, I like to assign an additional role to the current user (not to unauthenticated user). As far as I can see there is no module for that. So I guess I will have to write one on my own. Still, I'm struggling a little bit where to begin. For example, is the main domain module providing a hook, which I can implement so that I can add a role to the current user before the page is rendered? Which module is doing something similar so that I can take a look at the code?
Comments
Comment #1
agentrickardDynamic privilege esclation is a Very Bad Idea from a security perspective. You would want to poke Drupal core (likely hook_user or similar) to see where role assignments are done.
DA never touches this information. Just read the $_domain global and act accordingly, if you feel you must.
You can also, theoretically, use Domain Prefix to prefix the {users_roles} and {permissions} tables, and then set roles and permissions per-domain.
Comment #2
advseb commentedSecurity might be a concern, but not in my case. Users from a subdomain should just be not able to use fckeditor, so users of the main site get assigned an additional role with permissions set to use fckeditor. I thought that this is a very common use case, because in drupal you often control the availability of certain features through permissions.
Comment #3
agentrickardI would be tempted to manipulate the fckeditor settings (likely in the $conf array) rather than the user permissions.
Comment #4
advseb commented