Public Member Functions | Public Attributes

PermissionModule Class Reference

Inheritance diagram for PermissionModule:
BEAppModel AppModel

List of all members.

Public Member Functions

 replace ($module, $name, $switch, $flag)
 Add/modify permits for a module.
 remove ($module, $name, $switch)
 Delete a permit for a module.
 removeAll ($modules)
 Delete all permits of a module or an array of modules.
 permsByUserid ($userid, $module, $operations)
 Return an integer greater than 0, if user $userid has permits on module $module.
 permsByGroup ($groupid, $module, $operations)
 Return an integer greater than 0 if group $groupid has permits on module $module.
 getListModules ($userid)
 Get list of modules available for user.
 getPermissionModulesForGroup ($groupId)
 updateGroupPermission ($groupId, $moduleFlags)
 change module permissions for a group
 add ($names, &$perms)
 Add 1 or more permits to 1 or more modules.

Public Attributes

const SWITCH_USER = 'user'
const SWITCH_GROUP = 'group'
 $name = 'PermissionModule'
 $belongsTo

Detailed Description

Version:
$Revision$ $LastChangedBy$ $LastChangedDate$

$Id$

Definition at line 31 of file permission_module.php.


Member Function Documentation

PermissionModule::add ( names,
&$  perms 
)

Add 1 or more permits to 1 or more modules.

Parameters:
mixed $names If string, name of module if array, {0..N} names of modules
array $perms {1..N} items: name, switch, flag name userid or name of group switch PermissionComponent::SWITCH_USER or PermissionComponent::SWITCH_GROUP flag set of bits with the operations defined above
Returns:
boolean

Definition at line 350 of file permission_module.php.

References replace().

Referenced by updateGroupPermission().

PermissionModule::getListModules ( userid  ) 

Get list of modules available for user.

Parameters:
string $userid
Returns:
array

Definition at line 233 of file permission_module.php.

PermissionModule::permsByGroup ( groupid,
module,
operations 
)

Return an integer greater than 0 if group $groupid has permits on module $module.

Parameters:
mixed $groupid Group.id or Group.name
string $module
integer $operations
Returns:
integer

Definition at line 208 of file permission_module.php.

PermissionModule::permsByUserid ( userid,
module,
operations 
)

Return an integer greater than 0, if user $userid has permits on module $module.

Parameters:
string $userid
string $module
integer $operations
Returns:
integer

Definition at line 153 of file permission_module.php.

PermissionModule::remove ( module,
name,
switch 
)

Delete a permit for a module.

Parameters:
string $module module name
string $name userid or group name
string $switch user/group
Returns:
boolean

Definition at line 112 of file permission_module.php.

PermissionModule::removeAll ( modules  ) 

Delete all permits of a module or an array of modules.

Parameters:
mixed $names string (module name) or array of module names
Returns:
boolean

Definition at line 133 of file permission_module.php.

PermissionModule::replace ( module,
name,
switch,
flag 
)

Add/modify permits for a module.

Parameters:
string $module module name
string $name userid or group name
string $switch user/group
integer $flag permits bits
Returns:
boolean

Definition at line 64 of file permission_module.php.

Referenced by add().

PermissionModule::updateGroupPermission ( groupId,
moduleFlags 
)

change module permissions for a group

Parameters:
$groupId 
$moduleFlags array ('moduleName' => flag,....)

Definition at line 314 of file permission_module.php.

References add().


Member Data Documentation

PermissionModule::$belongsTo
Initial value:
 array(
        'Module',
        'Group' =>
            array(
                'className'     => 'Group',
                'conditions'    => "PermissionModule.switch = 'group' ",
                'foreignKey'    => 'ugid',
                'fields'        => 'name'
            ),
        'User' =>
            array(
                'className'     => 'User',
                'conditions'    => "PermissionModule.switch = 'user' ",
                'foreignKey'    => 'ugid',
                'fields'        => 'userid'
            ),
    )

Definition at line 38 of file permission_module.php.


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:47 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus