ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\BookingManager\Access\AccessManager Class Reference
+ Collaboration diagram for ILIAS\BookingManager\Access\AccessManager:

Public Member Functions

 __construct (InternalDomainService $domain, \ilAccessHandler $access)
 
 canManageObjects (int $ref_id, int $current_user=0)
 
 canManageSettings (int $ref_id, int $current_user=0)
 
 canManageParticipants (int $ref_id, int $current_user=0)
 
 filterManageableParticipants (int $ref_id, array $participant_ids)
 
 canManageAllReservations (int $ref_id, int $current_user=0)
 
 canManageOwnReservations (int $ref_id, int $current_user=0)
 
 canManageReservationForUser (int $ref_id, int $target_user, int $current_user=0)
 
 canRetrieveNotificationsForOwnReservationsByObjId (int $book_obj_id, int $current_user=0)
 
 canRetrieveNotificationsForAllReservationsByObjId (int $book_obj_id, int $current_user=0)
 
 getParentGroupCourse (int $ref_id)
 
 canManageMembersOfParent (int $ref_id)
 

Protected Member Functions

 getCurrentUserId (int $user_id)
 
 hasPermissionOnAnyReference (string $perm, int $uid, int $obj_id)
 

Protected Attributes

ilTree $tree
 
int $user_id
 
int $ref_id
 
ilAccessHandler $access
 
InternalDomainService $domain
 

Detailed Description

Definition at line 25 of file AccessManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\BookingManager\Access\AccessManager::__construct ( InternalDomainService  $domain,
\ilAccessHandler  $access 
)

Definition at line 33 of file AccessManager.php.

References ILIAS\BookingManager\Access\AccessManager\$access, ILIAS\BookingManager\Access\AccessManager\$domain, and ILIAS\Repository\access().

36  {
37  $this->domain = $domain;
38  $this->access = $access;
39  $this->tree = $this->domain->repositoryTree();
40  }
+ Here is the call graph for this function:

Member Function Documentation

◆ canManageAllReservations()

ILIAS\BookingManager\Access\AccessManager::canManageAllReservations ( int  $ref_id,
int  $current_user = 0 
)

Definition at line 86 of file AccessManager.php.

References ILIAS\Repository\access(), and ILIAS\BookingManager\Access\AccessManager\getCurrentUserId().

89  : bool {
90  $current_user = $this->getCurrentUserId($current_user);
91  return $this->access->checkAccessOfUser($current_user, "manage_all_reservations", "", $ref_id);
92  }
+ Here is the call graph for this function:

◆ canManageMembersOfParent()

ILIAS\BookingManager\Access\AccessManager::canManageMembersOfParent ( int  $ref_id)

Definition at line 164 of file AccessManager.php.

References ILIAS\Repository\access(), ILIAS\BookingManager\Access\AccessManager\getParentGroupCourse(), and null.

164  : bool
165  {
166  if (($parent = $this->getParentGroupCourse($ref_id)) !== null) {
167  return ($this->access->checkAccess("manage_members", "", (int) $parent["ref_id"])) ;
168  }
169  return false;
170  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ canManageObjects()

ILIAS\BookingManager\Access\AccessManager::canManageObjects ( int  $ref_id,
int  $current_user = 0 
)

Definition at line 50 of file AccessManager.php.

References ILIAS\Repository\access(), and ILIAS\BookingManager\Access\AccessManager\getCurrentUserId().

53  : bool {
54  $current_user = $this->getCurrentUserId($current_user);
55  return $this->access->checkAccessOfUser($current_user, "write", "", $ref_id);
56  }
+ Here is the call graph for this function:

◆ canManageOwnReservations()

ILIAS\BookingManager\Access\AccessManager::canManageOwnReservations ( int  $ref_id,
int  $current_user = 0 
)

Definition at line 94 of file AccessManager.php.

References ILIAS\Repository\access(), and ILIAS\BookingManager\Access\AccessManager\getCurrentUserId().

97  : bool {
98  $current_user = $this->getCurrentUserId($current_user);
99  return $this->access->checkAccessOfUser($current_user, "manage_own_reservations", "", $ref_id) ||
100  $this->access->checkAccessOfUser($current_user, "manage_all_reservations", "", $ref_id);
101  }
+ Here is the call graph for this function:

◆ canManageParticipants()

ILIAS\BookingManager\Access\AccessManager::canManageParticipants ( int  $ref_id,
int  $current_user = 0 
)

Definition at line 66 of file AccessManager.php.

References ILIAS\Repository\access(), and ILIAS\BookingManager\Access\AccessManager\getCurrentUserId().

69  : bool {
70  $current_user = $this->getCurrentUserId($current_user);
71  return $this->access->checkAccessOfUser($current_user, "write", "", $ref_id);
72  }
+ Here is the call graph for this function:

◆ canManageReservationForUser()

ILIAS\BookingManager\Access\AccessManager::canManageReservationForUser ( int  $ref_id,
int  $target_user,
int  $current_user = 0 
)

Definition at line 103 of file AccessManager.php.

References ILIAS\Repository\access(), and ILIAS\BookingManager\Access\AccessManager\getCurrentUserId().

107  : bool {
108  $current_user = $this->getCurrentUserId($current_user);
109  if ($target_user === $current_user) {
110  return $this->access->checkAccessOfUser($current_user, "manage_own_reservations", "", $ref_id) ||
111  $this->access->checkAccessOfUser($current_user, "manage_all_reservations", "", $ref_id);
112  }
113  return $this->access->checkAccessOfUser($current_user, "manage_all_reservations", "", $ref_id);
114  }
+ Here is the call graph for this function:

◆ canManageSettings()

ILIAS\BookingManager\Access\AccessManager::canManageSettings ( int  $ref_id,
int  $current_user = 0 
)

Definition at line 58 of file AccessManager.php.

References ILIAS\Repository\access(), and ILIAS\BookingManager\Access\AccessManager\getCurrentUserId().

61  : bool {
62  $current_user = $this->getCurrentUserId($current_user);
63  return $this->access->checkAccessOfUser($current_user, "write", "", $ref_id);
64  }
+ Here is the call graph for this function:

◆ canRetrieveNotificationsForAllReservationsByObjId()

ILIAS\BookingManager\Access\AccessManager::canRetrieveNotificationsForAllReservationsByObjId ( int  $book_obj_id,
int  $current_user = 0 
)

Definition at line 124 of file AccessManager.php.

References ILIAS\BookingManager\Access\AccessManager\getCurrentUserId(), and ILIAS\BookingManager\Access\AccessManager\hasPermissionOnAnyReference().

127  : bool {
128  $current_user = $this->getCurrentUserId($current_user);
129  return $this->hasPermissionOnAnyReference("manage_all_reservations", $current_user, $book_obj_id);
130  }
hasPermissionOnAnyReference(string $perm, int $uid, int $obj_id)
+ Here is the call graph for this function:

◆ canRetrieveNotificationsForOwnReservationsByObjId()

ILIAS\BookingManager\Access\AccessManager::canRetrieveNotificationsForOwnReservationsByObjId ( int  $book_obj_id,
int  $current_user = 0 
)

Definition at line 116 of file AccessManager.php.

References ILIAS\BookingManager\Access\AccessManager\getCurrentUserId(), and ILIAS\BookingManager\Access\AccessManager\hasPermissionOnAnyReference().

119  : bool {
120  $current_user = $this->getCurrentUserId($current_user);
121  return $this->hasPermissionOnAnyReference("manage_own_reservations", $current_user, $book_obj_id);
122  }
hasPermissionOnAnyReference(string $perm, int $uid, int $obj_id)
+ Here is the call graph for this function:

◆ filterManageableParticipants()

ILIAS\BookingManager\Access\AccessManager::filterManageableParticipants ( int  $ref_id,
array  $participant_ids 
)

Definition at line 74 of file AccessManager.php.

References ILIAS\Repository\access().

77  : array {
78  return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
79  'render',
80  'render',
81  $ref_id,
82  $participant_ids
83  );
84  }
+ Here is the call graph for this function:

◆ getCurrentUserId()

◆ getParentGroupCourse()

ILIAS\BookingManager\Access\AccessManager::getParentGroupCourse ( int  $ref_id)

Definition at line 146 of file AccessManager.php.

References ILIAS\BookingManager\Access\AccessManager\$tree, and null.

Referenced by ILIAS\BookingManager\Access\AccessManager\canManageMembersOfParent().

146  : ?array
147  {
148  $tree = $this->tree;
149  if (($par_ref_id = $tree->checkForParentType($ref_id, "grp")) > 0) {
150  return [
151  "ref_id" => $par_ref_id,
152  "type" => "grp"
153  ];
154  }
155  if (($par_ref_id = $tree->checkForParentType($ref_id, "crs")) > 0) {
156  return [
157  "ref_id" => $par_ref_id,
158  "type" => "crs"
159  ];
160  }
161  return null;
162  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
+ Here is the caller graph for this function:

◆ hasPermissionOnAnyReference()

ILIAS\BookingManager\Access\AccessManager::hasPermissionOnAnyReference ( string  $perm,
int  $uid,
int  $obj_id 
)
protected

Definition at line 132 of file AccessManager.php.

References ILIAS\BookingManager\Access\AccessManager\$access, and ilObject\_getAllReferences().

Referenced by ILIAS\BookingManager\Access\AccessManager\canRetrieveNotificationsForAllReservationsByObjId(), and ILIAS\BookingManager\Access\AccessManager\canRetrieveNotificationsForOwnReservationsByObjId().

136  : bool {
138  foreach (\ilObject::_getAllReferences($obj_id) as $ref_id) {
139  if ($access->checkAccessOfUser($uid, $perm, "", $ref_id)) {
140  return true;
141  }
142  }
143  return false;
144  }
static _getAllReferences(int $id)
get all reference ids for object ID
checkAccessOfUser(int $a_user_id, 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) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ILIAS\BookingManager\Access\AccessManager::$access
protected

◆ $domain

InternalDomainService ILIAS\BookingManager\Access\AccessManager::$domain
protected

◆ $ref_id

int ILIAS\BookingManager\Access\AccessManager::$ref_id
protected

Definition at line 29 of file AccessManager.php.

◆ $tree

ilTree ILIAS\BookingManager\Access\AccessManager::$tree
protected

◆ $user_id

int ILIAS\BookingManager\Access\AccessManager::$user_id
protected

The documentation for this class was generated from the following file: