1
zer0fill
(RESOLVED) Cascading group permissions problems
  • 2003/12/20 8:34

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Is it possible to create several groups with varying module-specific permissions? I went though the XoopsModuleGroupPermission and was able to get it working with individual groups but when i try to cascade permissions it doesn't seem to work. I'm testing permissions by doing:
// File: /modules/mymodule/index.php

$perm_name              'dirperm';
$groups                 = ($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$module_id              $xoopsModule->getVar('mid');
$gperm_handler          =  &xoops_gethandler('groupperm');
$perm['edit_locals']=$gperm_handler->checkRight($perm_name,1,$groups,$module_id);
$perm['edit_leadership']=$gperm_handler->checkRight($perm_name,2,$groups,$module_id);
$perm['delete_locals']=$gperm_handler->checkRight($perm_name,3,$groups,$module_id);
$perm['delete_leadership']=$gperm_handler->checkRight($perm_name,4,$groups,$module_id);
echo 
'<pre>',print_r($perm,1),'</pre>';

but when i try to cascade permissions (1 user in many groups), it only keeps permission from their original group.

ex:
1. registered users have no edit or delete permissions
2. zer0fill is a registered user
3. create editor group
4. go into module and enable edit_local and edit_leadership permission for editor group
5. add zer0fill to the editor group (zer0fill is now in both registered user and editor groups)

when testing what permissions zer0fill has, it is still none.

[edit]
Uh. Oh!
I added print_r($groups) and it only showed zer0fill is in the registered user group even though the Editors group shows zer0fill is still in there

[edit2]
Ok. So it was the session that was causing the trouble. After logging out/in, it saw that zer0fill is in both sessions

(i know i was talking in the 3rd person. it was just to make it clear i was talking about the account and not me personally)

Login

Who's Online

124 user(s) are online (76 user(s) are browsing Support Forums)


Members: 0


Guests: 124


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits