ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilTermsOfServiceUserHasGlobalRoleCriterion.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
11 protected $rbacReview;
12
14 protected $objectCache;
15
22 {
23 $this->rbacReview = $rbacReview;
24 $this->objectCache = $objectCache;
25 }
26
30 public function getTypeIdent() : string
31 {
32 return 'usr_global_role';
33 }
34
38 public function hasUniqueNature() : bool
39 {
40 return false;
41 }
42
47 {
48 $roleId = $config['role_id'] ?? 0;
49
50 if (!is_numeric($roleId) || $roleId < 1 || is_float($roleId)) {
51 return false;
52 }
53
54 if (!$this->rbacReview->isGlobalRole($roleId)) {
55 return false;
56 }
57
58 $result = $this->rbacReview->isAssigned($user->getId(), $roleId);
59
60 return $result;
61 }
62
67 {
68 return new ilTermsOfServiceUserHasGlobalRoleCriterionGUI($this, $lng, $this->rbacReview, $this->objectCache);
69 }
70}
$result
An exception for terminatinating execution or to throw for unit testing.
language handling
class ilObjectDataCache
getId()
get object id @access public
class ilRbacReview Contains Review functions of core Rbac.
Class ilTermsOfServiceCriterionConfig.
__construct(ilRbacReview $rbacReview, ilObjectDataCache $objectCache)
ilTermsOfServiceUserHasGlobalRoleCriterion constructor.
hasUniqueNature()
Returns whether or not a criterion is unique by it's nature.Example: "User Language"....
evaluate(ilObjUser $user, ilTermsOfServiceCriterionConfig $config)
bool
getTypeIdent()
Returns a unique id of the criterion type.string
Interface ilTermsOfServiceCriterionTypeGUI.
Interface ilTermsOfServiceCriterionType.
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
$lng