ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjWorkflowEngineAccess.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
27 {
32  public function _checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id = null): bool
33  {
34  global $DIC;
35  $rbacsystem = $DIC['rbacsystem'];
36  $lng = $DIC['lng'];
37  $ilUser = $DIC['ilUser'];
38  $ilAccess = $DIC['ilAccess'];
39 
40  if (is_null($user_id)) {
41  $user_id = $ilUser->getId();
42  }
43 
44  // Deal with commands
45  switch ($cmd) {
46  case "view":
47  $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("crs_status_blocked"));
48  return false;
49 
50  case 'leave':
51  }
52 
53  // Deal with permissions
54  switch ($permission) {
55  case 'visible':
56  return $rbacsystem->checkAccessOfUser($user_id, 'visible', $ref_id);
57 
58  case 'read':
59  return $rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id);
60  }
61 
62  return true; // ORLY?
63  }
64 }
$lng
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
_checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcc...
$ilUser
Definition: imgupload.php:34
Class ilObjWorkflowEngineAccess.