<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello. I'm new to this list, so please bear with me. I've been working
on a module for the past 9 months and recently submitted a request to
the CVS administrator for a project account. The administrator told me
I needed to run this project past the developers mailing list.<br>
<br>
I have posted details on the proposed project here: <a
class="moz-txt-link-freetext" href="http://drupal.org/node/87679">http://drupal.org/node/87679</a><br>
<br>
Essentially, I updated the existing og_roles module to be able to
define roles by individual groups. So, instead of assigning a role to
a user account and that user then having that role everywhere in the
site, my module assigns a role to a user in a group, and the user only
has the access granted by that role in the group that role is assigned
to him. Therefore, a user can now have different roles in different
groups.<br>
<br>
The problem is that in order to make this work, I needed to modify the
user_access function of the user.module to recognize roles based upon
the group context. <br>
<br>
Specifically, the changes I make are:<br>
<br>
1. Creating the og_users_roles table which is the same as the
users_roles
table except that adds the GroupID.
<br>
2. Modifying the user_access function so that it additionally reads the
og_users_roles
table, recognizes the existing group context (if any), and adds
whatever
roles are appropriate.
<br>
<br>
The change to the user.module is small: simply replacing <b>$user->roles</b>
with my function that returns the results of $user->roles + whatever
roles are allowed based upon the group (og user roles). I haven't
changed the core functionality of the function, only added the og user
roles addtional functionality. In other words, if there are no og user
roles, then the function still returns only <b>$user->roles</b>.
If there are og user roles, then the function returns those roles + <b>$user->roles</b>.<br>
<br>
Needless to say, the CVS administrator has a big problem with #2. He
asked that I run this concept by the developers mailing list in order
to see if anyone might have a workaround solution that doesn't involve
"hacking" the core. I don't see how you do it without user_access
recognizing the group context, but then again, everything I've learned
about Drupal has been through trial and error, so there is certainly a
ton of things I don't know.<br>
<br>
Any suggestions? <br>
<br>
Thanks.<br>
<pre class="moz-signature" cols="72">--
Ron Parker
Software Creations <a class="moz-txt-link-freetext" href="http://www.scbbs.com">http://www.scbbs.com</a>
Self-Administration Web Site <a class="moz-txt-link-freetext" href="http://saw.scbbs.com">http://saw.scbbs.com</a>
SDSS Subscription Mgmt Service <a class="moz-txt-link-freetext" href="http://sdss.scbbs.com">http://sdss.scbbs.com</a>
Central Ave Dance Ensemble <a class="moz-txt-link-freetext" href="http://www.centralavedance.com">http://www.centralavedance.com</a>
R & B Salsa <a class="moz-txt-link-freetext" href="http://www.randbsalsa.com">http://www.randbsalsa.com</a>
</pre>
</body>
</html>