User Overview anchor.png

This is not Alpha's spec, but Beta's spec.

Page Top

Description anchor.png

XOOPS Cube has different permission design from XOOPS2. That's the role base. Modules can check roles of the current user through the context object. 'module_read' and 'module_admin' of XOOPS2 permissions are converted to roles. You can check a permission by the groupperm handler also, but you should use the new style.

Page Top

Where is the principal object? anchor.png

You can access the principal object with the context object. The context object has many informations of the current access. At first, you need to get the XCube_Root object.

$root =& XCube_Root::getSingleton();

Next, you may access the principal object through the context object which is a property of the root.


If you can access the controller object, you may get the principal with the following method.

Page Top

System roles anchor.png

When Legacy with the user module keeps a user login, system roles are added to the current principal object. $xoopsUser is not good to check its permission, because it's null for anonymous users. But, the principal object is active for blocks and modules anytime.

Page Top

Site.GuestUser anchor.png

This is a special role for anonymous users.

/* XOOPS2 Style */
if (!is_object($xoopsUser)) ....

/* Cube Style */
$root =& XCube_Root::getSingleton();
if ($root->mContext->mUser->isInRole('Site.GuestUser')) ...
Page Top

Site.RegisteredUser anchor.png

This is a special role for registered users. This role is gived to a registered user, whether he belongs to XOOPS_GROUP_USERS.

Page Top

Site.Administrator anchor.png

This role is given to a user having admin permissions of one module or more. In other words, this role is the rights that a user can access to the control panel.

Page Top

Site.Owner anchor.png

This role is given to users belonging to XOOPS_GROUP_ADMIN.

Page Top

Module roles anchor.png

When the current user accesses to modules, Legacy loads his permissions with the groupperm handler and converts loaded permissions to roles. Therefore, Legacy sets roles about modules automatically for the current modules only.

Page Top

Module.{dirname}.Visitor anchor.png

This role is given to a user belonging to the group which has 'module_read'.

Page Top

Module.{dirname}.Admin anchor.png

This role is given to a user belonging to the group which has 'module_admin'. Therefore, this user has the 'Site.Administrator' role also.

Page Top

Module.{dirname}.{any} anchor.png


Front page   Freeze Diff Backup Copy Rename ReloadPrint View   New Page Page list Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom) Powered by xpWiki
Counter: 18384, today: 1, yesterday: 0
Princeps date: 2007-01-11 (Thu) 18:09:21
Last-modified: 2007-01-11 (Thu) 18:09:21 (JST) (5171d) by Anonymous

Welcome | News | Overview | Documentation | Forum | Tutorialstop
Brasilian | French | German | Greek | Japanese | Korean | Russian | T-Chinese
Powered by XOOPS Cube 2001-2011 The XOOPS Cube Project