ILIAS  release_8 Revision v8.24
class.ilTermsOfServiceUserHasGlobalRoleCriterion.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
29
31 {
32 $this->rbacReview = $rbacReview;
33 $this->objectCache = $objectCache;
34 }
35
36 public function getTypeIdent(): string
37 {
38 return 'usr_global_role';
39 }
40
41 public function hasUniqueNature(): bool
42 {
43 return false;
44 }
45
47 {
48 $roleId = $config['role_id'] ?? 0;
49
50 if (!is_numeric($roleId) || $roleId < 1 || $roleId > PHP_INT_MAX || is_float($roleId)) {
51 return false;
52 }
53
54 if (!$this->rbacReview->isGlobalRole((int) $roleId)) {
55 return false;
56 }
57
58 return $this->rbacReview->isAssigned($user->getId(), (int) $roleId);
59 }
60
62 {
63 return new ilTermsOfServiceUserHasGlobalRoleCriterionGUI($this, $lng, $this->rbacReview, $this->objectCache);
64 }
65}
language handling
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
class ilRbacReview Contains Review functions of core Rbac.
Class ilTermsOfServiceCriterionConfig.
__construct(ilRbacReview $rbacReview, ilObjectDataCache $objectCache)
hasUniqueNature()
Returns whether or not a criterion is unique by it's nature.
evaluate(ilObjUser $user, ilTermsOfServiceCriterionConfig $config)
Interface ilTermsOfServiceCriterionTypeGUI.
Interface ilTermsOfServiceCriterionType.
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
$lng