Minahito
minah****@users*****
2006年 9月 29日 (金) 19:43:41 JST
Index: xoops2jp/html/modules/base/kernel/Legacy_Identity.class.php diff -u xoops2jp/html/modules/base/kernel/Legacy_Identity.class.php:1.1.2.2 xoops2jp/html/modules/base/kernel/Legacy_Identity.class.php:1.1.2.3 --- xoops2jp/html/modules/base/kernel/Legacy_Identity.class.php:1.1.2.2 Fri Sep 29 17:14:20 2006 +++ xoops2jp/html/modules/base/kernel/Legacy_Identity.class.php Fri Sep 29 19:43:40 2006 @@ -1,7 +1,7 @@ <?php /** * @package Legacy - * @version $Id: Legacy_Identity.class.php,v 1.1.2.2 2006/09/29 08:14:20 minahito Exp $ + * @version $Id: Legacy_Identity.class.php,v 1.1.2.3 2006/09/29 10:43:40 minahito Exp $ */ class Legacy_Identity extends XCube_Identity @@ -31,8 +31,28 @@ } } +/** + * This principal is free to add roles. And, this is also an interface, because + * addRole() is used as a common interface in Legacy. Therefore, the dev team + * may add the interface class to this file. + * + * [Role Naming Convention] + * {dirname}.PrimitiveAccess is 'module_read'. + * {dirname}.PrimitiveManage is 'module_admin'. + */ class Legacy_GenericPrincipal extends XCube_Principal { + /** + * Adds a role to this object. + * @param $roleName string + */ + function addRole($roleName) + { + if (!$this->isInRole($roleName)) { + $this->_mRoles[] = $roleName; + } + } + function isInRole($roleName) { return in_array($roleName, $this->_mRoles);