ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.SkillManagementAccess.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
23 
29 {
30  protected \ilRbacSystem $access;
31  protected int $skmg_ref_id = 0;
32  protected int $usr_id = 0;
33 
34  public function __construct(\ilRbacSystem $access, int $skmg_ref_id, int $usr_id)
35  {
36  $this->access = $access;
37  $this->skmg_ref_id = $skmg_ref_id;
38  $this->usr_id = $usr_id;
39  }
40 
41  public function hasReadManagementPermission(int $a_usr_id = 0): bool
42  {
43  if ($a_usr_id == 0) {
44  $a_usr_id = $this->usr_id;
45  }
46  return $this->access->checkAccessOfUser($a_usr_id, "visible,read", $this->skmg_ref_id);
47  }
48 
49  public function hasEditManagementSettingsPermission(int $a_usr_id = 0): bool
50  {
51  if ($a_usr_id == 0) {
52  $a_usr_id = $this->usr_id;
53  }
54  return $this->access->checkAccessOfUser($a_usr_id, "write", $this->skmg_ref_id);
55  }
56 
57  public function hasEditManagementPermissionsPermission(int $a_usr_id = 0): bool
58  {
59  if ($a_usr_id == 0) {
60  $a_usr_id = $this->usr_id;
61  }
62  return $this->access->checkAccessOfUser($a_usr_id, "edit_permission", $this->skmg_ref_id);
63  }
64 
65  public function hasCreateTreePermission(int $a_usr_id = 0): bool
66  {
67  if ($a_usr_id == 0) {
68  $a_usr_id = $this->usr_id;
69  }
70  return $this->access->checkAccessOfUser($a_usr_id, "create_skee", $this->skmg_ref_id);
71  }
72 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(\ilRbacSystem $access, int $skmg_ref_id, int $usr_id)