ILIAS
release_8 Revision v8.19
|
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...
Public Member Functions | |||||||||||||
__construct () | |||||||||||||
storeAccessResult (string $a_permission, string $a_cmd, int $a_ref_id, bool $a_access_granted, ?int $a_user_id=null, ?ilAccessInfo $a_info=null) | |||||||||||||
store access result More... | |||||||||||||
setPreventCachingLastResult (bool $a_val) | |||||||||||||
Set prevent caching last result. More... | |||||||||||||
getPreventCachingLastResult () | |||||||||||||
Get prevent caching last result. More... | |||||||||||||
getStoredAccessResult (string $a_permission, string $a_cmd, int $a_ref_id, ?int $a_user_id=null) | |||||||||||||
get stored access result
| |||||||||||||
storeCache () | |||||||||||||
readCache (int $a_secs=0) | |||||||||||||
getResults () | |||||||||||||
setResults (array $a_results) | |||||||||||||
addInfoItem (string $a_type, string $a_text, string $a_data="") | |||||||||||||
add an info item to current info object More... | |||||||||||||
checkAccess (string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null) | |||||||||||||
check access for an object (provide $a_type and $a_obj_id if available for better performance) More... | |||||||||||||
checkAccessOfUser (int $a_user_id, string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=0, ?int $a_tree_id=0) | |||||||||||||
check access for an object (provide $a_type and $a_obj_id if available for better performance) More... | |||||||||||||
getInfo () | |||||||||||||
get last info object
| |||||||||||||
getResultLast () | |||||||||||||
get last info object More... | |||||||||||||
getResultAll (int $a_ref_id=0) | |||||||||||||
doCacheCheck (string $a_permission, string $a_cmd, int $a_ref_id, int $a_user_id) | |||||||||||||
look if result for current query is already in cache
| |||||||||||||
doTreeCheck (string $a_permission, string $a_cmd, int $a_ref_id, int $a_user_id) | |||||||||||||
check if object is in tree and not deleted More... | |||||||||||||
doRBACCheck (string $a_permission, string $a_cmd, int $a_ref_id, int $a_user_id, string $a_type) | |||||||||||||
rbac check for current object -> type is used for create permission More... | |||||||||||||
doPathCheck (string $a_permission, string $a_cmd, int $a_ref_id, int $a_user_id, bool $a_all=false) | |||||||||||||
check read permission for all parents More... | |||||||||||||
doActivationCheck (string $a_permission, string $a_cmd, int $a_ref_id, int $a_user_id, int $a_obj_id, string $a_type) | |||||||||||||
check for activation and centralized offline status. More... | |||||||||||||
doConditionCheck (string $a_permission, string $a_cmd, int $a_ref_id, int $a_user_id, int $a_obj_id, string $a_type) | |||||||||||||
condition check (currently only implemented for read permission) More... | |||||||||||||
doStatusCheck (string $a_permission, string $a_cmd, int $a_ref_id, int $a_user_id, int $a_obj_id, string $a_type) | |||||||||||||
object type specific check More... | |||||||||||||
clear () | |||||||||||||
enable (string $a_str, bool $a_bool) | |||||||||||||
filterUserIdsForCurrentUsersPositionsAndPermission (array $user_ids, string $permission) | |||||||||||||
| |||||||||||||
filterUserIdsForUsersPositionsAndPermission (array $user_ids, int $for_user_id, string $permission) | |||||||||||||
| |||||||||||||
isCurrentUserBasedOnPositionsAllowedTo (string $permission, array $on_user_ids) | |||||||||||||
| |||||||||||||
isUserBasedOnPositionsAllowedTo (int $which_user_id, string $permission, array $on_user_ids) | |||||||||||||
| |||||||||||||
checkPositionAccess (string $pos_perm, int $ref_id) | |||||||||||||
| |||||||||||||
checkRbacOrPositionPermissionAccess (string $rbac_perm, string $pos_perm, int $ref_id) | |||||||||||||
| |||||||||||||
filterUserIdsByPositionOfCurrentUser (string $pos_perm, int $ref_id, array $user_ids) | |||||||||||||
| |||||||||||||
filterUserIdsByPositionOfUser (int $user_id, string $pos_perm, int $ref_id, array $user_ids) | |||||||||||||
| |||||||||||||
filterUserIdsByRbacOrPositionOfCurrentUser (string $rbac_perm, string $pos_perm, int $ref_id, array $user_ids) | |||||||||||||
| |||||||||||||
hasCurrentUserAnyPositionAccess (int $ref_id) | |||||||||||||
| |||||||||||||
hasUserRBACorAnyPositionAccess (string $rbac_perm, int $ref_id) | |||||||||||||
Protected Attributes | |
ilOrgUnitPositionAccess | $ilOrgUnitPositionAccess |
array | $obj_tree_cache |
array | $obj_type_cache |
array | $obj_id_cache |
array | $ac_cache |
bool | $status |
bool | $path |
bool | $condition |
bool | $tree |
bool | $rbac |
bool | $cache |
ilAccessInfo | $current_info |
ilAccessInfo | $last_info = null |
array | $results = [] |
array | $last_result = [] |
array | $stored_rbac_access = [] |
array | $current_result_element = [] |
ilRbacSystem | $rbacsystem |
ilObjUser | $user |
ilLogger | $ac_logger |
ilDBInterface | $db |
ilTree | $repositoryTree |
ilObjectDefinition | $objDefinition |
ilLanguage | $language = null |
Private Member Functions | |
getLanguage () | |
Private Attributes | |
const | MAX_CACHE_SIZE = 1000 |
bool | $prevent_caching_last_result = false |
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilAccessHandler Checks access for ILIAS objects
Definition at line 27 of file class.ilAccess.php.
ilAccess::__construct | ( | ) |
Definition at line 62 of file class.ilAccess.php.
References $DIC, ilLoggerFactory\getLogger(), ILIAS\Repository\rbac(), ILIAS\Repository\repositoryTree(), and ILIAS\Repository\user().
ilAccess::addInfoItem | ( | string | $a_type, |
string | $a_text, | ||
string | $a_data = "" |
||
) |
add an info item to current info object
Implements ilRBACAccessHandler.
Definition at line 218 of file class.ilAccess.php.
ilAccess::checkAccess | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
string | $a_type = "" , |
||
?int | $a_obj_id = null , |
||
?int | $a_tree_id = null |
||
) |
check access for an object (provide $a_type and $a_obj_id if available for better performance)
Implements ilRBACAccessHandler.
Definition at line 226 of file class.ilAccess.php.
References checkAccessOfUser(), and ILIAS\Repository\user().
Referenced by ilSessionClassificationPathGUI\findSessionContainerForItem(), and ilOrgUnitRecursiveUserAssignmentTableGUI\mayViewLPIn().
ilAccess::checkAccessOfUser | ( | int | $a_user_id, |
string | $a_permission, | ||
string | $a_cmd, | ||
int | $a_ref_id, | ||
string | $a_type = "" , |
||
?int | $a_obj_id = 0 , |
||
?int | $a_tree_id = 0 |
||
) |
check access for an object (provide $a_type and $a_obj_id if available for better performance)
Implements ilRBACAccessHandler.
Definition at line 248 of file class.ilAccess.php.
References $DIC, ilObject\_lookupObjId(), ilObject\_lookupType(), doActivationCheck(), doCacheCheck(), doConditionCheck(), doPathCheck(), doRBACCheck(), doStatusCheck(), doTreeCheck(), getLanguage(), ilAccessInfo\IL_NO_PERMISSION, setPreventCachingLastResult(), and storeAccessResult().
Referenced by checkAccess(), doActivationCheck(), doConditionCheck(), doPathCheck(), and ilExerciseDerivedTaskProvider\getFirstRefIdWithPermission().
ilAccess::checkPositionAccess | ( | string | $pos_perm, |
int | $ref_id | ||
) |
string | $pos_perm | |
int | $ref_id | Reference-ID of the desired Object in the tree |
Implements ilOrgUnitPositionAccessHandler.
Definition at line 807 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\checkPositionAccess().
ilAccess::checkRbacOrPositionPermissionAccess | ( | string | $rbac_perm, |
string | $pos_perm, | ||
int | $ref_id | ||
) |
string | $rbac_perm | |
string | $pos_perm | See the list of available permissions in interface ilOrgUnitPositionAccessHandler |
int | $ref_id | Reference-ID of the desired Object in the tree |
Implements ilOrgUnitPositionAndRBACAccessHandler.
Definition at line 815 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\checkRbacOrPositionPermissionAccess().
ilAccess::clear | ( | ) |
Implements ilRBACAccessHandler.
Definition at line 738 of file class.ilAccess.php.
ilAccess::doActivationCheck | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
int | $a_user_id, | ||
int | $a_obj_id, | ||
string | $a_type | ||
) |
check for activation and centralized offline status.
Implements ilRBACAccessHandler.
Definition at line 545 of file class.ilAccess.php.
References checkAccessOfUser(), ilMemberViewSettings\getInstance(), ilObjectActivation\getItem(), ilObject\lookupOfflineStatus(), ilObjectActivation\TIMINGS_ACTIVATION, and ILIAS\Repository\user().
Referenced by checkAccessOfUser().
ilAccess::doCacheCheck | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
int | $a_user_id | ||
) |
look if result for current query is already in cache
Implements ilRBACAccessHandler.
Definition at line 393 of file class.ilAccess.php.
References getStoredAccessResult().
Referenced by checkAccessOfUser().
ilAccess::doConditionCheck | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
int | $a_user_id, | ||
int | $a_obj_id, | ||
string | $a_type | ||
) |
condition check (currently only implemented for read permission)
Implements ilRBACAccessHandler.
Definition at line 630 of file class.ilAccess.php.
References ilConditionHandler\_checkAllConditionsOfTarget(), ilObject\_lookupTitle(), checkAccessOfUser(), getLanguage(), and ilAccessInfo\IL_MISSING_PRECONDITION.
Referenced by checkAccessOfUser().
ilAccess::doPathCheck | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
int | $a_user_id, | ||
bool | $a_all = false |
||
) |
check read permission for all parents
Implements ilRBACAccessHandler.
Definition at line 515 of file class.ilAccess.php.
References $id, checkAccessOfUser(), getLanguage(), ilAccessInfo\IL_NO_PARENT_ACCESS, and ILIAS\Repository\repositoryTree().
Referenced by checkAccessOfUser().
ilAccess::doRBACCheck | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
int | $a_user_id, | ||
string | $a_type | ||
) |
rbac check for current object -> type is used for create permission
Implements ilRBACAccessHandler.
Definition at line 472 of file class.ilAccess.php.
References $message, getLanguage(), ilAccessInfo\IL_NO_PERMISSION, and storeAccessResult().
Referenced by checkAccessOfUser().
ilAccess::doStatusCheck | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
int | $a_user_id, | ||
int | $a_obj_id, | ||
string | $a_type | ||
) |
object type specific check
Implements ilRBACAccessHandler.
Definition at line 683 of file class.ilAccess.php.
References $location, and storeAccessResult().
Referenced by checkAccessOfUser().
ilAccess::doTreeCheck | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
int | $a_user_id | ||
) |
check if object is in tree and not deleted
Implements ilRBACAccessHandler.
Definition at line 421 of file class.ilAccess.php.
References getLanguage(), ilAccessInfo\IL_DELETED, ilAccessInfo\IL_NO_PERMISSION, ILIAS\Repository\repositoryTree(), and storeAccessResult().
Referenced by checkAccessOfUser().
ilAccess::enable | ( | string | $a_str, |
bool | $a_bool | ||
) |
Implements ilRBACAccessHandler.
Definition at line 750 of file class.ilAccess.php.
ilAccess::filterUserIdsByPositionOfCurrentUser | ( | string | $pos_perm, |
int | $ref_id, | ||
array | $user_ids | ||
) |
string | $pos_perm | |
int | $ref_id | |
int[] | $user_ids |
Implements ilOrgUnitPositionAccessHandler.
Definition at line 823 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\filterUserIdsByPositionOfCurrentUser().
ilAccess::filterUserIdsByPositionOfUser | ( | int | $user_id, |
string | $pos_perm, | ||
int | $ref_id, | ||
array | $user_ids | ||
) |
int | $user_id | |
string | $pos_perm | |
int | $ref_id | |
int[] | $user_ids |
Implements ilOrgUnitPositionAccessHandler.
Definition at line 831 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\filterUserIdsByPositionOfUser().
ilAccess::filterUserIdsByRbacOrPositionOfCurrentUser | ( | string | $rbac_perm, |
string | $pos_perm, | ||
int | $ref_id, | ||
array | $user_ids | ||
) |
string | $rbac_perm | |
string | $pos_perm | See the list of available permissions in interface ilOrgUnitPositionAccessHandler |
int | $ref_id | Reference-ID of the desired Object in the tree |
int[] | $user_ids |
Implements ilOrgUnitPositionAndRBACAccessHandler.
Definition at line 839 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\filterUserIdsByRbacOrPositionOfCurrentUser().
ilAccess::filterUserIdsForCurrentUsersPositionsAndPermission | ( | array | $user_ids, |
string | $permission | ||
) |
int[] | $user_ids List of ILIAS-User-IDs which shall be filtered | |
string | $permission |
Implements ilOrgUnitPositionAccessHandler.
Definition at line 764 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\filterUserIdsForCurrentUsersPositionsAndPermission().
ilAccess::filterUserIdsForUsersPositionsAndPermission | ( | array | $user_ids, |
int | $for_user_id, | ||
string | $permission | ||
) |
int[] | $user_ids List of ILIAS-User-IDs which shall be filtered | |
int | $for_user_id | |
string | $permission |
Implements ilOrgUnitPositionAccessHandler.
Definition at line 775 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\filterUserIdsForUsersPositionsAndPermission().
ilAccess::getInfo | ( | ) |
get last info object
Implements ilRBACAccessHandler.
Definition at line 365 of file class.ilAccess.php.
|
private |
Definition at line 91 of file class.ilAccess.php.
References $DIC, $language, and ILIAS\UI\examples\Symbol\Glyph\Language\language().
Referenced by checkAccessOfUser(), doConditionCheck(), doPathCheck(), doRBACCheck(), and doTreeCheck().
ilAccess::getPreventCachingLastResult | ( | ) |
Get prevent caching last result.
Implements ilRBACAccessHandler.
Definition at line 143 of file class.ilAccess.php.
References $prevent_caching_last_result.
Referenced by storeAccessResult().
ilAccess::getResultAll | ( | int | $a_ref_id = 0 | ) |
Implements ilRBACAccessHandler.
Definition at line 381 of file class.ilAccess.php.
References $results.
ilAccess::getResultLast | ( | ) |
get last info object
Implements ilRBACAccessHandler.
Definition at line 373 of file class.ilAccess.php.
References $last_result.
ilAccess::getResults | ( | ) |
Implements ilRBACAccessHandler.
Definition at line 202 of file class.ilAccess.php.
References $results.
ilAccess::getStoredAccessResult | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
?int | $a_user_id = null |
||
) |
get stored access result
string | $a_permission | permission |
string | $a_cmd | command string |
int | $a_ref_id | reference id |
int | null | $a_user_id | user id (if no id passed, current user id) |
Implements ilRBACAccessHandler.
Definition at line 151 of file class.ilAccess.php.
References ILIAS\Repository\user().
Referenced by doCacheCheck().
ilAccess::hasCurrentUserAnyPositionAccess | ( | int | $ref_id | ) |
int | $ref_id |
Implements ilOrgUnitPositionAccessHandler.
Definition at line 852 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\hasCurrentUserAnyPositionAccess().
ilAccess::hasUserRBACorAnyPositionAccess | ( | string | $rbac_perm, |
int | $ref_id | ||
) |
Implements ilOrgUnitPositionAndRBACAccessHandler.
Definition at line 860 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\hasUserRBACorAnyPositionAccess().
ilAccess::isCurrentUserBasedOnPositionsAllowedTo | ( | string | $permission, |
array | $on_user_ids | ||
) |
string | $permission | |
int[] | $on_user_ids List of ILIAS-User-IDs |
Implements ilOrgUnitPositionAccessHandler.
Definition at line 787 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\isCurrentUserBasedOnPositionsAllowedTo().
ilAccess::isUserBasedOnPositionsAllowedTo | ( | int | $which_user_id, |
string | $permission, | ||
array | $on_user_ids | ||
) |
int | $which_user_id | Permission check for this ILIAS-User-ID |
string | $permission | |
int[] | $on_user_ids List of ILIAS-User-IDs |
Implements ilOrgUnitPositionAccessHandler.
Definition at line 795 of file class.ilAccess.php.
References ilOrgUnitPositionAccess\isUserBasedOnPositionsAllowedTo().
ilAccess::readCache | ( | int | $a_secs = 0 | ) |
Implements ilRBACAccessHandler.
Definition at line 184 of file class.ilAccess.php.
References $query, ilDBConstants\FETCHMODE_ASSOC, and ILIAS\Repository\user().
ilAccess::setPreventCachingLastResult | ( | bool | $a_val | ) |
Set prevent caching last result.
Implements ilRBACAccessHandler.
Definition at line 135 of file class.ilAccess.php.
Referenced by checkAccessOfUser().
ilAccess::setResults | ( | array | $a_results | ) |
Implements ilRBACAccessHandler.
Definition at line 210 of file class.ilAccess.php.
ilAccess::storeAccessResult | ( | string | $a_permission, |
string | $a_cmd, | ||
int | $a_ref_id, | ||
bool | $a_access_granted, | ||
?int | $a_user_id = null , |
||
?ilAccessInfo | $a_info = null |
||
) |
store access result
Implements ilRBACAccessHandler.
Definition at line 104 of file class.ilAccess.php.
References $current_info, getPreventCachingLastResult(), and ILIAS\Repository\user().
Referenced by checkAccessOfUser(), doRBACCheck(), doStatusCheck(), and doTreeCheck().
ilAccess::storeCache | ( | ) |
Implements ilRBACAccessHandler.
Definition at line 169 of file class.ilAccess.php.
References $query, $res, and ILIAS\Repository\user().
|
protected |
Definition at line 35 of file class.ilAccess.php.
|
protected |
Definition at line 55 of file class.ilAccess.php.
|
protected |
Definition at line 42 of file class.ilAccess.php.
|
protected |
Definition at line 39 of file class.ilAccess.php.
|
protected |
Definition at line 46 of file class.ilAccess.php.
Referenced by storeAccessResult().
|
protected |
Definition at line 51 of file class.ilAccess.php.
|
protected |
Definition at line 56 of file class.ilAccess.php.
|
protected |
Definition at line 31 of file class.ilAccess.php.
|
protected |
Definition at line 60 of file class.ilAccess.php.
Referenced by getLanguage().
|
protected |
Definition at line 47 of file class.ilAccess.php.
|
protected |
Definition at line 49 of file class.ilAccess.php.
Referenced by getResultLast().
|
protected |
Definition at line 34 of file class.ilAccess.php.
|
protected |
Definition at line 32 of file class.ilAccess.php.
|
protected |
Definition at line 33 of file class.ilAccess.php.
|
protected |
Definition at line 58 of file class.ilAccess.php.
|
protected |
Definition at line 38 of file class.ilAccess.php.
|
private |
Definition at line 44 of file class.ilAccess.php.
Referenced by getPreventCachingLastResult().
|
protected |
Definition at line 41 of file class.ilAccess.php.
|
protected |
Definition at line 53 of file class.ilAccess.php.
|
protected |
Definition at line 57 of file class.ilAccess.php.
|
protected |
Definition at line 48 of file class.ilAccess.php.
Referenced by getResultAll(), and getResults().
|
protected |
Definition at line 37 of file class.ilAccess.php.
|
protected |
Definition at line 50 of file class.ilAccess.php.
|
protected |
Definition at line 40 of file class.ilAccess.php.
|
protected |
Definition at line 54 of file class.ilAccess.php.
|
private |
Definition at line 29 of file class.ilAccess.php.