47 public static function getInstance($a_user_id = null, $a_ref_id = null)
52 $a_user_id = $ilUser->getId();
55 $a_ref_id = (int) $_REQUEST[
"ref_id"];
57 if (!isset(self::$instances[$a_user_id][$a_ref_id])) {
58 self::$instances[$a_user_id][$a_ref_id] =
new static($a_user_id, $a_ref_id);
60 return self::$instances[$a_user_id][$a_ref_id];
68 $this->context_ids =
array();
81 $this->user_id = (int) $a_value;
101 $this->ref_id = (int) $a_value;
150 if (!$a_action_sub_id) {
155 if (array_key_exists($a_action_id, $this->map[
$a_context_type][
"subactions"]) &&
156 in_array($a_action_sub_id, $this->map[$a_context_type][
"subactions"][$a_action_id])) {
169 trigger_error(
"INVALID permission context - " .
$a_context_type .
":" .
$a_context_id .
":" . $a_action_id .
":" . $a_action_sub_id, E_USER_WARNING);
219 foreach ($a_action_ids as $action_id) {
220 if (is_array($action_id)) {
221 $action_sub_id = $action_id[1];
222 $action_id = $action_id[0];
258 return $ilAccess->checkAccessOfUser($this->
getUserId(),
"write",
"", $this->
getRefId());
281 if (!is_array($this->plugins)) {
285 foreach ($this->plugins as $plugin) {
static getInstance($a_user_id=null, $a_ref_id=null)
Factory.
hasPermissions($a_context_type, $a_context_id, array $a_action_ids)
Check permissions.
Claiming permission helper base class.
checkPermission($a_context_type, $a_context_id, $a_action_id, $a_action_sub_id=null)
Check permission (helper: rbac, plugins)
readContextIds($a_context_type)
Get all context ids for context type (from DB, is cached)
getActivePlugins()
Get active plugins (for current slot)
buildPermissionMap()
Build map of context and actions.
hasPermission($a_context_type, $a_context_id, $a_action_id, $a_action_sub_id=null)
Check permission.
reset()
Reset (internal caches)
foreach($_POST as $key=> $value) $res
checkRBAC()
Check permission against RBAC.
isValidContextAndAction($a_context_type, $a_context_id, $a_action_id, $a_action_sub_id=null)
Check if given combination of context and action is valid.
setRefId($a_value)
Set ref id.
Create styles array
The data for the language used.
checkPlugins($a_context_type, $a_context_id, $a_action_id, $a_action_sub_id=null)
Check permission against plugins.
__construct($a_user_id, $a_ref_id)
Constructor.
setUserId($a_value)
Set user id.
getValidContextIds($a_context_type)
Get context ids for context type (uses cache)