ILIAS
Release_3_10_x_branch Revision 61812
|
class ilRbacReview Contains Review functions of core Rbac. More...
Public Member Functions | |
ilRbacReview () | |
Constructor public. | |
searchRolesByMailboxAddressList ($a_address_list) | |
Finds all role ids that match the specified user friendly role mailbox address list. | |
getRoleMailboxAddress ($a_role_id, $is_localize=true) | |
Returns the mailbox address of a role. | |
roleExists ($a_title, $a_id=0) | |
Checks if a role already exists. | |
__getParentRoles ($a_path, $a_templates, $a_keep_protected) | |
DEPRECTED use getParentRoles instead. | |
getParentRoleIds ($a_endnode_id, $a_templates=false, $a_keep_protected=false) | |
get an array of parent role ids of all parent roles, if last parameter is set true you get also all parent templates public | |
getRoleListByObject ($a_ref_id, $a_templates=false) | |
Returns a list of roles in an container public. | |
getAssignableRoles ($a_templates=false, $a_internal_roles=false) | |
Returns a list of all assignable roles public. | |
getAssignableRolesInSubtree ($ref_id) | |
Returns a list of assignable roles in a subtree of the repository public. | |
getAssignableChildRoles ($a_ref_id) | |
Get all assignable roles under a specific node public. | |
__setTemplateFilter ($a_templates) | |
get roles and templates or only roles; returns string for where clause private | |
__setRoleType ($a_role_list) | |
computes role type in role list array: global: roles in ROLE_FOLDER_ID local: assignable roles in other role folders linked: roles with stoppped inheritance template: role templates | |
assignedUsers ($a_rol_id, $a_fields=NULL) | |
get all assigned users to a given role public | |
isAssigned ($a_usr_id, $a_role_id) | |
check if a specific user is assigned to specific role public | |
isAssignedToAtLeastOneGivenRole ($a_usr_id, $a_role_ids) | |
check if a specific user is assigned to at least one of the | |
assignedRoles ($a_usr_id) | |
get all assigned roles to a given user public | |
isAssignable ($a_rol_id, $a_ref_id) | |
Check if its possible to assign users public. | |
getFoldersAssignedToRole ($a_rol_id, $a_assignable=false) | |
returns an array of role folder ids assigned to a role. | |
getRolesOfRoleFolder ($a_ref_id, $a_nonassignable=true) | |
get all roles of a role folder including linked local roles that are created due to stopped inheritance returns an array with role ids public | |
getGlobalRoles () | |
get only 'global' roles public | |
getGlobalRolesArray () | |
get only 'global' roles public | |
getGlobalAssignableRoles () | |
get only 'global' roles (with flag 'assign_users') public | |
__getAllRoleFolderIds () | |
get all role folder ids private | |
getRoleFolderOfObject ($a_ref_id) | |
returns the data of a role folder assigned to an object public | |
getRoleFolderIdOfObject ($a_ref_id) | |
getOperations () | |
get all possible operations public | |
getOperation ($ops_id) | |
get one operation by operation id public | |
getOperationsOfRole ($a_rol_id, $a_type, $a_parent=0) | |
get all possible operations of a specific role The ref_id of the role folder (parent object) is necessary to distinguish local roles public | |
getRoleOperationsOnObject ($a_role_id, $a_ref_id) | |
getOperationsOnType ($a_typ_id) | |
all possible operations of a type public | |
getOperationsOnTypeString ($a_type) | |
all possible operations of a type public | |
getObjectsWithStopedInheritance ($a_rol_id) | |
get all objects in which the inheritance of role with role_id was stopped the function returns all reference ids of objects containing a role folder. | |
isDeleted ($a_node_id) | |
checks if a rolefolder is set as deleted (negative tree_id) public | |
getRolesByFilter ($a_filter=0, $a_user_id=0) | |
getTypeId ($a_type) | |
_getOperationIdsByName ($operations) | |
get ops_id's by name. | |
getLinkedRolesOfRoleFolder ($a_ref_id) | |
get all linked local roles of a role folder that are created due to stopped inheritance returns an array with role ids public | |
isProtected ($a_ref_id, $a_role_id) | |
__setProtectedStatus ($a_parent_roles, $a_role_hierarchy, $a_ref_id) | |
getObjectOfRole ($a_role_id) | |
Get object id of objects a role is assigned to. | |
isRoleDeleted ($a_role_id) | |
return if role is only attached to deleted role folders | |
getRolesForIDs ($role_ids, $use_templates) |
Static Public Member Functions | |
static | _getOperationIdByName ($a_operation) |
get operation id by name of operation public static | |
static | _getOperationList ($a_type=null) |
get operation list by object type TODO: rename function to: getOperationByType public static | |
static | _groupOperationsByClass ($a_ops_arr) |
Data Fields | |
$log = null |
Protected Member Functions | |
getParentRoles ($a_path, $a_templates, $a_keep_protected) | |
get parent roles (NEW implementation) |
Protected Attributes | |
$assigned_roles = array() |
Static Private Attributes | |
static | $_opsCache = null |
class ilRbacReview Contains Review functions of core Rbac.
This class offers the possibility to view the contents of the user <-> role (UR) relation and the permission <-> role (PR) relation. For example, from the UA relation the administrator should have the facility to view all user assigned to a given role.
Definition at line 40 of file class.ilRbacReview.php.
ilRbacReview::__getAllRoleFolderIds | ( | ) |
get all role folder ids private
Definition at line 1240 of file class.ilRbacReview.php.
References DB_FETCHMODE_OBJECT.
ilRbacReview::__getParentRoles | ( | $a_path, | |
$a_templates, | |||
$a_keep_protected | |||
) |
DEPRECTED use getParentRoles instead.
This version is much to slow on big installations
Get parent roles in a path. If last parameter is set 'true' it delivers also all templates in the path private
array | array with path_ids |
boolean | true for role templates (default: false) |
Definition at line 624 of file class.ilRbacReview.php.
References $in, $log, __setProtectedStatus(), DB_FETCHMODE_OBJECT, getRoleListByObject(), and ilUtil\quoteArray().
Referenced by getParentRoleIds().
ilRbacReview::__setProtectedStatus | ( | $a_parent_roles, | |
$a_role_hierarchy, | |||
$a_ref_id | |||
) |
Definition at line 1718 of file class.ilRbacReview.php.
References $log, and assignedRoles().
Referenced by __getParentRoles(), and getParentRoles().
ilRbacReview::__setRoleType | ( | $a_role_list | ) |
computes role type in role list array: global: roles in ROLE_FOLDER_ID local: assignable roles in other role folders linked: roles with stoppped inheritance template: role templates
private
array | role list |
Definition at line 877 of file class.ilRbacReview.php.
Referenced by getAssignableRoles(), getAssignableRolesInSubtree(), getRoleListByObject(), getRolesByFilter(), and getRolesForIDs().
ilRbacReview::__setTemplateFilter | ( | $a_templates | ) |
get roles and templates or only roles; returns string for where clause private
boolean | true: with templates |
Definition at line 852 of file class.ilRbacReview.php.
Referenced by getAssignableRoles(), getAssignableRolesInSubtree(), getRoleListByObject(), and getRolesForIDs().
|
static |
get operation id by name of operation public static
string | operation name |
Definition at line 1639 of file class.ilRbacReview.php.
References $ilErr, and DB_FETCHMODE_OBJECT.
Referenced by ilRbacSystem\checkAccessOfUser().
ilRbacReview::_getOperationIdsByName | ( | $operations | ) |
get ops_id's by name.
Example usage: $rbacadmin->grantPermission($roles,ilRbacReview::_getOperationIdsByName(array('visible','read'),$ref_id));
public
array | string name of operation. see rbac_operations |
Definition at line 1611 of file class.ilRbacReview.php.
References $res, DB_FETCHMODE_OBJECT, and ilUtil\quoteArray().
Referenced by ilUtil\_getObjectsByOperations(), ilObjChat\initDefaultRoles(), and ilObjCourseGUI\updateECSExportSettings().
|
static |
get operation list by object type TODO: rename function to: getOperationByType public static
string | object type you want to have the operation list |
string | order column |
string | order direction (possible values: ASC or DESC) |
Definition at line 1782 of file class.ilRbacReview.php.
Referenced by ilObjTypeDefinitionGUI\editObject(), ilObjectStatusGUI\getAssignedValidRoles(), ilObjectStatusGUI\getPermissionInfo(), ilPermissionGUI\getRolesData(), and ilObjTypeDefinitionGUI\viewObject().
|
static |
Definition at line 1818 of file class.ilRbacReview.php.
Referenced by ilPermissionGUI\getRolesData().
ilRbacReview::assignedRoles | ( | $a_usr_id | ) |
get all assigned roles to a given user public
integer | usr_id |
Definition at line 1052 of file class.ilRbacReview.php.
References DB_FETCHMODE_OBJECT.
Referenced by __setProtectedStatus(), and getRolesByFilter().
ilRbacReview::assignedUsers | ( | $a_rol_id, | |
$a_fields = NULL |
|||
) |
get all assigned users to a given role public
integer | role_id |
array | columns to get form usr_data table (optional) |
Definition at line 925 of file class.ilRbacReview.php.
References $ilBench, and DB_FETCHMODE_ASSOC.
ilRbacReview::getAssignableChildRoles | ( | $a_ref_id | ) |
Get all assignable roles under a specific node public.
ref_id |
Definition at line 824 of file class.ilRbacReview.php.
References DB_FETCHMODE_ASSOC.
ilRbacReview::getAssignableRoles | ( | $a_templates = false , |
|
$a_internal_roles = false |
|||
) |
Returns a list of all assignable roles public.
boolean | if true fetch template roles too |
Definition at line 759 of file class.ilRbacReview.php.
References __setRoleType(), __setTemplateFilter(), and DB_FETCHMODE_ASSOC.
Referenced by getRolesByFilter().
ilRbacReview::getAssignableRolesInSubtree | ( | $ref_id | ) |
Returns a list of assignable roles in a subtree of the repository public.
ref_id | Rfoot node of subtree |
Definition at line 791 of file class.ilRbacReview.php.
References $ref_id, __setRoleType(), __setTemplateFilter(), and DB_FETCHMODE_ASSOC.
ilRbacReview::getFoldersAssignedToRole | ( | $a_rol_id, | |
$a_assignable = false |
|||
) |
returns an array of role folder ids assigned to a role.
A role with stopped inheritance may be assigned to more than one rolefolder. To get only the original location of a role, set the second parameter to true
public
integer | role id |
boolean | get only rolefolders where role is assignable (true) |
Definition at line 1121 of file class.ilRbacReview.php.
References DB_FETCHMODE_OBJECT.
Referenced by getObjectsWithStopedInheritance(), and isRoleDeleted().
ilRbacReview::getGlobalAssignableRoles | ( | ) |
get only 'global' roles (with flag 'assign_users') public
Definition at line 1220 of file class.ilRbacReview.php.
References ilObjRole\_getAssignUsersStatus(), and getGlobalRoles().
ilRbacReview::getGlobalRoles | ( | ) |
get only 'global' roles public
Definition at line 1195 of file class.ilRbacReview.php.
References getRolesOfRoleFolder().
Referenced by getGlobalAssignableRoles(), and getRolesByFilter().
ilRbacReview::getGlobalRolesArray | ( | ) |
get only 'global' roles public
Definition at line 1205 of file class.ilRbacReview.php.
References getRolesOfRoleFolder().
ilRbacReview::getLinkedRolesOfRoleFolder | ( | $a_ref_id | ) |
get all linked local roles of a role folder that are created due to stopped inheritance returns an array with role ids public
integer | ref_id of object |
boolean | if false only get true local roles |
Definition at line 1677 of file class.ilRbacReview.php.
References DB_FETCHMODE_OBJECT.
ilRbacReview::getObjectOfRole | ( | $a_role_id | ) |
Get object id of objects a role is assigned to.
public
int | role id |
Definition at line 1838 of file class.ilRbacReview.php.
References $res, and DB_FETCHMODE_OBJECT.
ilRbacReview::getObjectsWithStopedInheritance | ( | $a_rol_id | ) |
get all objects in which the inheritance of role with role_id was stopped the function returns all reference ids of objects containing a role folder.
public
integer | role_id |
Definition at line 1452 of file class.ilRbacReview.php.
References getFoldersAssignedToRole().
ilRbacReview::getOperation | ( | $ops_id | ) |
get one operation by operation id public
Definition at line 1319 of file class.ilRbacReview.php.
References $res, and DB_FETCHMODE_OBJECT.
ilRbacReview::getOperations | ( | ) |
get all possible operations public
Definition at line 1297 of file class.ilRbacReview.php.
References $res, and DB_FETCHMODE_OBJECT.
ilRbacReview::getOperationsOfRole | ( | $a_rol_id, | |
$a_type, | |||
$a_parent = 0 |
|||
) |
get all possible operations of a specific role The ref_id of the role folder (parent object) is necessary to distinguish local roles public
integer | role_id |
string | object type |
integer | role folder id |
Definition at line 1345 of file class.ilRbacReview.php.
References $ilLog, and DB_FETCHMODE_OBJECT.
ilRbacReview::getOperationsOnType | ( | $a_typ_id | ) |
all possible operations of a type public
integer | object_ID of type |
Definition at line 1405 of file class.ilRbacReview.php.
References DB_FETCHMODE_OBJECT.
Referenced by getOperationsOnTypeString().
ilRbacReview::getOperationsOnTypeString | ( | $a_type | ) |
all possible operations of a type public
integer | object_ID of type |
Definition at line 1432 of file class.ilRbacReview.php.
References $res, DB_FETCHMODE_OBJECT, and getOperationsOnType().
ilRbacReview::getParentRoleIds | ( | $a_endnode_id, | |
$a_templates = false , |
|||
$a_keep_protected = false |
|||
) |
get an array of parent role ids of all parent roles, if last parameter is set true you get also all parent templates public
integer | ref_id of an object which is end node |
boolean | true for role templates (default: false) |
Definition at line 691 of file class.ilRbacReview.php.
References $log, and __getParentRoles().
|
protected |
get parent roles (NEW implementation)
protected
@return |
Definition at line 553 of file class.ilRbacReview.php.
References $log, $res, __setProtectedStatus(), DB_FETCHMODE_OBJECT, getRoleFolderIdOfObject(), and getRoleListByObject().
ilRbacReview::getRoleFolderIdOfObject | ( | $a_ref_id | ) |
Definition at line 1280 of file class.ilRbacReview.php.
References getRoleFolderOfObject().
Referenced by getParentRoles().
ilRbacReview::getRoleFolderOfObject | ( | $a_ref_id | ) |
returns the data of a role folder assigned to an object public
integer | ref_id of object with a rolefolder object under it |
Definition at line 1261 of file class.ilRbacReview.php.
References $ilBench.
Referenced by getRoleFolderIdOfObject().
ilRbacReview::getRoleListByObject | ( | $a_ref_id, | |
$a_templates = false |
|||
) |
Returns a list of roles in an container public.
integer | ref_id |
boolean | if true fetch template roles too |
Definition at line 719 of file class.ilRbacReview.php.
References __setRoleType(), __setTemplateFilter(), and DB_FETCHMODE_ASSOC.
Referenced by __getParentRoles(), and getParentRoles().
ilRbacReview::getRoleMailboxAddress | ( | $a_role_id, | |
$is_localize = true |
|||
) |
Returns the mailbox address of a role.
Example 1: Mailbox address for an ILIAS reserved role name
a) Course Member <#member@[English Course 1]> b) Course Member <#il_crs_member_345@[English Course 1]> c) Course Member <#il_crs_member_345>
Address a) is returned, if the title of the object is unique, and if there is only one local role with the substring "member" defined for the object.
Address b) is returned, if the title of the object is unique, but there is more than one local role with the substring "member" in its title.
Address c) is returned, if the title of the course object is not unique.
Example 2: Mailbox address for a manually defined role name
a) Course Administrator <#Admin> b) Course Administrator <#Admin> c) Course Adminstrator <#il_role_34211>
Address a) is returned, if the title of the object is unique, and if there is only one local role with the substring "Admin" defined for the course object. Address b) is returned, if the title of the object is not unique, but
the role title is unique.
Address c) is returned, if neither the role title nor the title of the course object is unique.
Example 3: Mailbox address for a manually defined role title that can contains special characters in the local-part of a mailbox address
a) "#Author Courses" b) Author Courses <#il_role_34234>
Address a) is returned, if the title of the role is unique.
Address b) is returned, if neither the role title nor the title of the course object is unique, or if the role title contains a quote or a backslash.
int | a role id |
boolean | is_localize whether mailbox addresses should be localized |
Definition at line 329 of file class.ilRbacReview.php.
References $lng, $log, ilMail\_usePearMail(), DB_FETCHMODE_OBJECT, and if.
ilRbacReview::getRoleOperationsOnObject | ( | $a_role_id, | |
$a_ref_id | |||
) |
Definition at line 1382 of file class.ilRbacReview.php.
References $res, and DB_FETCHMODE_OBJECT.
ilRbacReview::getRolesByFilter | ( | $a_filter = 0 , |
|
$a_user_id = 0 |
|||
) |
Definition at line 1506 of file class.ilRbacReview.php.
References __setRoleType(), assignedRoles(), DB_FETCHMODE_ASSOC, getAssignableRoles(), getGlobalRoles(), and ilUtil\quoteArray().
ilRbacReview::getRolesForIDs | ( | $role_ids, | |
$use_templates | |||
) |
Definition at line 1881 of file class.ilRbacReview.php.
References __setRoleType(), __setTemplateFilter(), and DB_FETCHMODE_ASSOC.
ilRbacReview::getRolesOfRoleFolder | ( | $a_ref_id, | |
$a_nonassignable = true |
|||
) |
get all roles of a role folder including linked local roles that are created due to stopped inheritance returns an array with role ids public
integer | ref_id of object |
boolean | if false only get true local roles |
Definition at line 1156 of file class.ilRbacReview.php.
References $ilBench, $ilLog, and DB_FETCHMODE_OBJECT.
Referenced by getGlobalRoles(), and getGlobalRolesArray().
ilRbacReview::getTypeId | ( | $a_type | ) |
Definition at line 1590 of file class.ilRbacReview.php.
References DB_FETCHMODE_OBJECT.
ilRbacReview::ilRbacReview | ( | ) |
Constructor public.
Definition at line 52 of file class.ilRbacReview.php.
References $ilErr, $ilLog, and if.
ilRbacReview::isAssignable | ( | $a_rol_id, | |
$a_ref_id | |||
) |
Check if its possible to assign users public.
integer | object id of role |
integer | ref_id of object in question |
Definition at line 1080 of file class.ilRbacReview.php.
References $ilBench.
ilRbacReview::isAssigned | ( | $a_usr_id, | |
$a_role_id | |||
) |
check if a specific user is assigned to specific role public
integer | usr_id |
integer | role_id |
Definition at line 987 of file class.ilRbacReview.php.
References $res.
ilRbacReview::isAssignedToAtLeastOneGivenRole | ( | $a_usr_id, | |
$a_role_ids | |||
) |
check if a specific user is assigned to at least one of the
given role ids.
This function is used to quickly check whether a user is member of a course or a group.
@access public @param integer usr_id @param array[integer] role_ids @return boolean
Definition at line 1014 of file class.ilRbacReview.php.
References $res, and DB_FETCHMODE_OBJECT.
ilRbacReview::isDeleted | ( | $a_node_id | ) |
checks if a rolefolder is set as deleted (negative tree_id) public
integer | ref_id of rolefolder |
Definition at line 1478 of file class.ilRbacReview.php.
References DB_FETCHMODE_OBJECT.
Referenced by isRoleDeleted().
ilRbacReview::isProtected | ( | $a_ref_id, | |
$a_role_id | |||
) |
Definition at line 1703 of file class.ilRbacReview.php.
References ilUtil\yn2tf().
ilRbacReview::isRoleDeleted | ( | $a_role_id | ) |
return if role is only attached to deleted role folders
int | $a_role_id |
Definition at line 1863 of file class.ilRbacReview.php.
References getFoldersAssignedToRole(), and isDeleted().
ilRbacReview::roleExists | ( | $a_title, | |
$a_id = 0 |
|||
) |
Checks if a role already exists.
Role title should be unique public
string | role title |
integer | obj_id of role to exclude in the check. Commonly this is the current role you want to edit |
Definition at line 521 of file class.ilRbacReview.php.
References DB_FETCHMODE_OBJECT.
ilRbacReview::searchRolesByMailboxAddressList | ( | $a_address_list | ) |
Finds all role ids that match the specified user friendly role mailbox address list.
The role mailbox name address list is an e-mail address list according to IETF RFC 822:
address list = role mailbox, {"," role mailbox } ; role mailbox = "#", local part, ["@" domain] ;
Examples: The following role mailbox names are all resolved to the role il_crs_member_123:
#Course.A #member.A #il_crs_member_123.A #il_crs_member_123 #il_crs_member_123
Examples: The following role mailbox names are all resolved to the role il_crs_member_345:
#member@[English Course] #il_crs_member_345@[English Course] #il_crs_member_345 #il_crs_member_345
If only the local part is specified, or if domain is equal to "ilias", ILIAS compares the title of role objects with local part. Only roles that are not in a trash folder are considered for the comparison.
If a domain is specified, and if the domain is not equal to "ilias", ILIAS compares the title of objects with the domain. Only objects that are not in a trash folder are considered for the comparison. Then ILIAS searches for local roles which contain the local part in their title. This allows for abbreviated role names, e.g. instead of having to specify #il_grp_member_345, it is sufficient to specify #member.
The address list may contain addresses thate are not role mailboxes. These addresses are ignored.
If a role mailbox address is ambiguous, this function returns the ID's of all role objects that are possible recipients for the role mailbox address.
If Pear Mail is not installed, then the mailbox address
public
string | IETF RFX 822 address list containing role mailboxes. |
Definition at line 118 of file class.ilRbacReview.php.
References $title, ilMail\_usePearMail(), and DB_FETCHMODE_OBJECT.
|
staticprivate |
Definition at line 46 of file class.ilRbacReview.php.
|
protected |
Definition at line 42 of file class.ilRbacReview.php.
ilRbacReview::$log = null |
Definition at line 43 of file class.ilRbacReview.php.
Referenced by __getParentRoles(), __setProtectedStatus(), getParentRoleIds(), getParentRoles(), and getRoleMailboxAddress().