ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Class ilRbacAdmin Core functions for role based access control. More...
Public Member Functions | |
__construct () | |
Constructor public. More... | |
setBlockedStatus ($a_role_id, $a_ref_id, $a_blocked_status) | |
Set blocked status. More... | |
removeUser ($a_usr_id) | |
deletes a user from rbac_ua all user <-> role relations are deleted public More... | |
deleteRole ($a_rol_id, $a_ref_id) | |
Deletes a role and deletes entries in object_data, rbac_pa, rbac_templates, rbac_ua, rbac_fa public. More... | |
deleteTemplate ($a_obj_id) | |
Deletes a template from role folder and deletes all entries in rbac_templates, rbac_fa public. More... | |
deleteLocalRole ($a_rol_id, $a_ref_id=0) | |
Deletes a local role and entries in rbac_fa and rbac_templates public. More... | |
assignUserLimited ($a_role_id, $a_usr_id, $a_limit, $a_limited_roles=array()) | |
Assign user limited. More... | |
assignUser ($a_rol_id, $a_usr_id) | |
Assigns an user to a role. More... | |
deassignUser ($a_rol_id, $a_usr_id) | |
Deassigns a user from a role. More... | |
grantPermission ($a_rol_id, $a_ops, $a_ref_id) | |
Grants a permission to an object and a specific role. More... | |
revokePermission ($a_ref_id, $a_rol_id=0, $a_keep_protected=true) | |
Revokes permissions of an object of one role. More... | |
revokeSubtreePermissions ($a_ref_id, $a_role_id) | |
Revoke subtree permissions. More... | |
deleteSubtreeTemplates ($a_ref_id, $a_rol_id) | |
Delete all template permissions of subtree nodes. More... | |
revokePermissionList ($a_ref_ids, $a_rol_id) | |
Revokes permissions of a LIST of objects of ONE role. More... | |
copyRolePermissions ($a_source_id, $a_source_parent, $a_dest_parent, $a_dest_id, $a_consider_protected=true) | |
Copies template permissions and permission of one role to another. More... | |
copyRoleTemplatePermissions ($a_source_id, $a_source_parent, $a_dest_parent, $a_dest_id, $a_consider_protected=true) | |
Copies template permissions of one role to another. More... | |
copyRolePermissionIntersection ($a_source1_id, $a_source1_parent, $a_source2_id, $a_source2_parent, $a_dest_parent, $a_dest_id) | |
Copies the intersection of the template permissions of two roles to a third role. More... | |
copyRolePermissionUnion ( $a_source1_id, $a_source1_parent, $a_source2_id, $a_source2_parent, $a_dest_id, $a_dest_parent) | |
<type> $ilDB More... | |
copyRolePermissionSubtract ($a_source_id, $a_source_parent, $a_dest_id, $a_dest_parent) | |
Subtract role permissions. More... | |
deleteRolePermission ($a_rol_id, $a_ref_id, $a_type=false) | |
Deletes all entries of a template. More... | |
setRolePermission ($a_rol_id, $a_type, $a_ops, $a_ref_id) | |
Inserts template permissions in rbac_templates for an specific object type. More... | |
assignRoleToFolder ($a_rol_id, $a_parent, $a_assign="y") | |
Assigns a role to an role folder A role folder is an object to store roles. More... | |
assignOperationToObject ($a_type_id, $a_ops_id) | |
Assign an existing operation to an object Update of rbac_ta. More... | |
deassignOperationFromObject ($a_type_id, $a_ops_id) | |
Deassign an existing operation from an object Update of rbac_ta public. More... | |
setProtected ($a_ref_id, $a_role_id, $a_value) | |
Set protected $ilDB. More... | |
copyLocalRoles ($a_source_id, $a_target_id) | |
Copy local roles This method creates a copy of all local role. More... | |
initIntersectionPermissions ($a_ref_id, $a_role_id, $a_role_parent, $a_template_id, $a_template_parent) | |
Init intersection permissions. More... | |
adjustMovedObjectPermissions ($a_ref_id, $a_old_parent) | |
Adjust permissions of moved objects. More... | |
Protected Member Functions | |
addDesktopItem ($a_rol_id, $a_usr_id) | |
Add desktop item. More... | |
applyMovedObjectDidacticTemplates ($a_ref_id, $a_old_parent) | |
Apply didactic templates after object movement. More... | |
Class ilRbacAdmin Core functions for role based access control.
Creation and maintenance of Relations. The main relations of Rbac are user <-> role (UR) assignment relation and the permission <-> role (PR) assignment relation. This class contains methods to 'create' and 'delete' instances of the (UR) relation e.g.: assignUser(), deassignUser() Required methods for the PR relation are grantPermission(), revokePermission()
Definition at line 18 of file class.ilRbacAdmin.php.
ilRbacAdmin::__construct | ( | ) |
Constructor public.
Definition at line 24 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $ilErr, if, and PEAR_ERROR_CALLBACK.
|
protected |
Add desktop item.
type | $a_rol_id | |
type | $a_usr_id |
Definition at line 262 of file class.ilRbacAdmin.php.
References ilObjUser\_addDesktopItem().
Referenced by assignUser(), and assignUserLimited().
ilRbacAdmin::adjustMovedObjectPermissions | ( | $a_ref_id, | |
$a_old_parent | |||
) |
Adjust permissions of moved objects.
public
int | ref id of moved object |
int | ref_id of old parent |
Definition at line 1297 of file class.ilRbacAdmin.php.
References $DIC, $ilLog, $log, $nodes, $tree, ilRbacLog\add(), applyMovedObjectDidacticTemplates(), deleteLocalRole(), ilRbacLog\diffFaPa(), ilRbacLog\gatherFaPa(), grantPermission(), initIntersectionPermissions(), ilRbacLog\isActive(), ilObjCourse\lookupCourseNonMemberTemplatesId(), ilObjGroup\lookupGroupStatusTemplateId(), ilRbacLog\MOVE_OBJECT, and revokePermission().
|
protected |
Apply didactic templates after object movement.
int | $a_ref_id | |
int | $a_old_parent |
Definition at line 1267 of file class.ilRbacAdmin.php.
References $action, ilDidacticTemplateActionFactory\getActionsByTemplateId(), and ilDidacticTemplateObjSettings\lookupTemplateId().
Referenced by adjustMovedObjectPermissions().
ilRbacAdmin::assignOperationToObject | ( | $a_type_id, | |
$a_ops_id | |||
) |
Assign an existing operation to an object Update of rbac_ta.
public
integer | object type |
integer | operation_id |
Definition at line 1068 of file class.ilRbacAdmin.php.
ilRbacAdmin::assignRoleToFolder | ( | $a_rol_id, | |
$a_parent, | |||
$a_assign = "y" |
|||
) |
Assigns a role to an role folder A role folder is an object to store roles.
Every role is assigned to minimum one role folder If the inheritance of a role is stopped, a new role template will created, and the role is assigned to minimum two role folders. All roles with stopped inheritance need the flag '$a_assign = false'
public
integer | object id of role |
integer | ref_id of role folder |
string | assignable('y','n'); default: 'y' |
Definition at line 1012 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $message, $query, $res, and ilLoggerFactory\getLogger().
Referenced by copyLocalRoles(), and initIntersectionPermissions().
ilRbacAdmin::assignUser | ( | $a_rol_id, | |
$a_usr_id | |||
) |
Assigns an user to a role.
Update of table rbac_ua
int | $a_rol_id | Object-ID of role |
int | $a_usr_id | Object-ID of user |
Definition at line 281 of file class.ilRbacAdmin.php.
References $DIC, $GLOBALS, $ilDB, $message, $query, $res, $type, ilLDAPRoleGroupMapping\_getInstance(), ilObject\_lookupObjId(), ilObject\_lookupType(), addDesktopItem(), and ilLoggerFactory\getInstance().
ilRbacAdmin::assignUserLimited | ( | $a_role_id, | |
$a_usr_id, | |||
$a_limit, | |||
$a_limited_roles = array() |
|||
) |
Assign user limited.
type | $a_role_id | |
type | $a_usr_id | |
type | $a_limit |
Definition at line 212 of file class.ilRbacAdmin.php.
References $DIC, $GLOBALS, $ilDB, $query, $res, $ret, $row, ilLDAPRoleGroupMapping\_getInstance(), addDesktopItem(), ilDBConstants\FETCHMODE_OBJECT, ilDBInterface\in(), ilDBInterface\manipulate(), ilDBInterface\query(), and ilDBInterface\quote().
ilRbacAdmin::copyLocalRoles | ( | $a_source_id, | |
$a_target_id | |||
) |
Copy local roles This method creates a copy of all local role.
Note: auto generated roles are excluded
public
int | source id of object (not role folder) |
int | target id of object |
Definition at line 1149 of file class.ilRbacAdmin.php.
References $DIC, $ilLog, $title, assignRoleToFolder(), and copyRolePermissions().
ilRbacAdmin::copyRolePermissionIntersection | ( | $a_source1_id, | |
$a_source1_parent, | |||
$a_source2_id, | |||
$a_source2_parent, | |||
$a_dest_parent, | |||
$a_dest_id | |||
) |
Copies the intersection of the template permissions of two roles to a third role.
public
integer | $a_source1_id | role_id source |
integer | $a_source1_parent | parent_id source |
integer | $a_source2_id | role_id source |
integer | $a_source2_parent | parent_id source |
integer | $a_dest_id | role_id destination |
integer | $a_dest_parent | parent_id destination |
Definition at line 735 of file class.ilRbacAdmin.php.
References $DIC, $GLOBALS, $ilDB, $key, $message, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and ilLoggerFactory\getLogger().
Referenced by initIntersectionPermissions().
ilRbacAdmin::copyRolePermissions | ( | $a_source_id, | |
$a_source_parent, | |||
$a_dest_parent, | |||
$a_dest_id, | |||
$a_consider_protected = true |
|||
) |
Copies template permissions and permission of one role to another.
public
integer | $a_source_id | role_id source |
integer | $a_source_parent | parent_id source |
integer | $a_dest_parent | parent_id destination |
integer | $a_dest_id | role_id destination |
Definition at line 638 of file class.ilRbacAdmin.php.
References $DIC, $tree, copyRoleTemplatePermissions(), grantPermission(), and revokePermission().
Referenced by copyLocalRoles().
ilRbacAdmin::copyRolePermissionSubtract | ( | $a_source_id, | |
$a_source_parent, | |||
$a_dest_id, | |||
$a_dest_parent | |||
) |
ilRbacAdmin::copyRolePermissionUnion | ( | $a_source1_id, | |
$a_source1_parent, | |||
$a_source2_id, | |||
$a_source2_parent, | |||
$a_dest_id, | |||
$a_dest_parent | |||
) |
<type> $ilDB
<type> | $a_source1_id |
<type> | $a_source1_parent |
<type> | $a_source2_id |
<type> | $a_source2_parent |
<type> | $a_dest_id |
<type> | $a_dest_parent |
Definition at line 815 of file class.ilRbacAdmin.php.
References $DIC, $GLOBALS, $ilDB, $query, $type, and deleteRolePermission().
ilRbacAdmin::copyRoleTemplatePermissions | ( | $a_source_id, | |
$a_source_parent, | |||
$a_dest_parent, | |||
$a_dest_id, | |||
$a_consider_protected = true |
|||
) |
Copies template permissions of one role to another.
It's also possible to copy template permissions from/to RoleTemplateObject public
integer | $a_source_id | role_id source |
integer | $a_source_parent | parent_id source |
integer | $a_dest_parent | parent_id destination |
integer | $a_dest_id | role_id destination |
Definition at line 665 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $message, $query, $res, $row, and setProtected().
Referenced by copyRolePermissions().
ilRbacAdmin::deassignOperationFromObject | ( | $a_type_id, | |
$a_ops_id | |||
) |
ilRbacAdmin::deassignUser | ( | $a_rol_id, | |
$a_usr_id | |||
) |
Deassigns a user from a role.
Update of table rbac_ua
int | $a_rol_id | Object-ID of role |
int | $a_usr_id | Object-ID of user |
Definition at line 341 of file class.ilRbacAdmin.php.
References $DIC, $GLOBALS, $ilDB, $message, $query, $res, $type, ilLDAPRoleGroupMapping\_getInstance(), ilObject\_lookupObjId(), ilObject\_lookupType(), and ilLoggerFactory\getInstance().
Referenced by removeUser().
ilRbacAdmin::deleteLocalRole | ( | $a_rol_id, | |
$a_ref_id = 0 |
|||
) |
Deletes a local role and entries in rbac_fa and rbac_templates public.
integer | object_id of role |
integer | ref_id of role folder (optional) |
Definition at line 174 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $message, $query, and $res.
Referenced by adjustMovedObjectPermissions(), and deleteRole().
ilRbacAdmin::deleteRole | ( | $a_rol_id, | |
$a_ref_id | |||
) |
Deletes a role and deletes entries in object_data, rbac_pa, rbac_templates, rbac_ua, rbac_fa public.
integer | obj_id of role (role_id) |
integer | ref_id of role folder (ref_id) |
Definition at line 98 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $lng, $message, $query, $res, ilLDAPRoleGroupMapping\_getInstance(), and deleteLocalRole().
ilRbacAdmin::deleteRolePermission | ( | $a_rol_id, | |
$a_ref_id, | |||
$a_type = false |
|||
) |
Deletes all entries of a template.
If an object type is given for third parameter only the entries for that object type are deleted Update of table rbac_templates. public
integer | object id of role |
integer | ref_id of role folder |
string | object type (optional) |
Definition at line 914 of file class.ilRbacAdmin.php.
References $a_type, $DIC, $ilDB, $message, $query, and $res.
Referenced by copyRolePermissionUnion().
ilRbacAdmin::deleteSubtreeTemplates | ( | $a_ref_id, | |
$a_rol_id | |||
) |
Delete all template permissions of subtree nodes.
object | $a_ref_id | |
object | $a_rol_id |
Definition at line 569 of file class.ilRbacAdmin.php.
References $DIC, $GLOBALS, $ilDB, and $query.
ilRbacAdmin::deleteTemplate | ( | $a_obj_id | ) |
ilRbacAdmin::grantPermission | ( | $a_rol_id, | |
$a_ops, | |||
$a_ref_id | |||
) |
Grants a permission to an object and a specific role.
Update of table rbac_pa public
integer | object id of role |
array | array of operation ids |
integer | reference id of that object which is granted the permissions |
Definition at line 389 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $key, $query, and $res.
Referenced by adjustMovedObjectPermissions(), copyRolePermissions(), and initIntersectionPermissions().
ilRbacAdmin::initIntersectionPermissions | ( | $a_ref_id, | |
$a_role_id, | |||
$a_role_parent, | |||
$a_template_id, | |||
$a_template_parent | |||
) |
Init intersection permissions.
type $rbacreview
type | $a_ref_id | |
type | $a_role_id | |
type | $a_role_parent | |
type | $a_template_id | |
type | $a_template_parent |
Definition at line 1197 of file class.ilRbacAdmin.php.
References $DIC, ilObject\_lookupType(), assignRoleToFolder(), copyRolePermissionIntersection(), ilLoggerFactory\getLogger(), grantPermission(), and revokePermission().
Referenced by adjustMovedObjectPermissions().
ilRbacAdmin::removeUser | ( | $a_usr_id | ) |
deletes a user from rbac_ua all user <-> role relations are deleted public
int | user_id |
Definition at line 69 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $message, $query, $res, and deassignUser().
ilRbacAdmin::revokePermission | ( | $a_ref_id, | |
$a_rol_id = 0 , |
|||
$a_keep_protected = true |
|||
) |
Revokes permissions of an object of one role.
Update of table rbac_pa. Revokes all permission for all roles for that object (with this reference). When a role_id is given this applies only to that role public
integer | reference id of object where permissions should be revoked |
integer | role_id (optional: if you want to revoke permissions of object only for a specific role) |
Definition at line 456 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $ilLog, $log, $message, $query, and $res.
Referenced by adjustMovedObjectPermissions(), copyRolePermissions(), and initIntersectionPermissions().
ilRbacAdmin::revokePermissionList | ( | $a_ref_ids, | |
$a_rol_id | |||
) |
Revokes permissions of a LIST of objects of ONE role.
Update of table rbac_pa. public
array | list of reference_ids to revoke permissions |
integer | role_id |
Definition at line 599 of file class.ilRbacAdmin.php.
ilRbacAdmin::revokeSubtreePermissions | ( | $a_ref_id, | |
$a_role_id | |||
) |
Revoke subtree permissions.
object | $a_ref_id | |
object | $a_role_id |
Definition at line 548 of file class.ilRbacAdmin.php.
References $DIC, $GLOBALS, $ilDB, and $query.
ilRbacAdmin::setBlockedStatus | ( | $a_role_id, | |
$a_ref_id, | |||
$a_blocked_status | |||
) |
Set blocked status.
type | $a_role_id | |
type | $a_ref_id | |
type | $a_blocked_status |
Definition at line 49 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $query, and ilLoggerFactory\getLogger().
ilRbacAdmin::setProtected | ( | $a_ref_id, | |
$a_role_id, | |||
$a_value | |||
) |
Set protected $ilDB.
type | $a_ref_id | |
type | $a_role_id | |
type | $a_value | y or n |
Definition at line 1124 of file class.ilRbacAdmin.php.
References $DIC, $ilDB, $query, and $res.
Referenced by copyRoleTemplatePermissions().
ilRbacAdmin::setRolePermission | ( | $a_rol_id, | |
$a_type, | |||
$a_ops, | |||
$a_ref_id | |||
) |
Inserts template permissions in rbac_templates for an specific object type.
Update of table rbac_templates public
integer | role_id |
string | object type |
array | operation_ids |
integer | ref_id of role folder object |
Definition at line 954 of file class.ilRbacAdmin.php.
References $a_type, $DIC, $ilDB, and $message.