ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjItemGroupAccess.php
Go to the documentation of this file.
1<?php
2
24{
25 protected ilObjUser $user;
26 protected ilLanguage $lng;
29
30 public function __construct()
31 {
32 global $DIC;
33
34 $this->user = $DIC->user();
35 $this->lng = $DIC->language();
36 $this->rbacsystem = $DIC->rbac()->system();
37 $this->access = $DIC->access();
38 }
39
40 public static function _getCommands(): array
41 {
42 global $DIC;
43
44 $DIC->language()->loadLanguageModule("itgr");
45 $commands = array(
46 array("permission" => "read", "cmd" => "gotoParent", "lang_var" => "", "default" => true),
47 array("permission" => "write", "cmd" => "listMaterials", "lang_var" => "itgr_assign_materials", "default" => false),
48 array("permission" => "write", "cmd" => "edit", "lang_var" => "settings", "default" => false)
49 );
50
51 return $commands;
52 }
53
54 public function _checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id = null): bool
55 {
56 return true;
57 }
58
59 public static function _checkGoto(string $target): bool
60 {
61 global $DIC;
62
63 $ilAccess = $DIC->access();
64
65 $t_arr = explode("_", $target);
66
67 if ($t_arr[0] != "itgr" || ((int) $t_arr[1]) <= 0) {
68 return false;
69 }
70
71 if ($ilAccess->checkAccess("read", "", $t_arr[1])) {
72 return true;
73 }
74 return false;
75 }
76}
language handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getCommands()
get commands
_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...
static _checkGoto(string $target)
check whether goto script will succeed
User class.
Class ilObjectAccess.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:26