ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilOrgUnitPermissionQueries.php
Go to the documentation of this file.
1 <?php
2 
26 {
28 
29  protected static function getPermissionRepo()
30  {
31  if (!isset(self::$permissionRepo)) {
33  self::$permissionRepo = $dic["repo.Permissions"];
34  }
35 
36  return self::$permissionRepo;
37  }
38 
42  public static function getTemplateSetForContextName(string $context_name, string $position_id, bool $editable = false): ilOrgUnitPermission
43  {
44  return self::getPermissionRepo()->getDefaultForContext($context_name, (int) $position_id, $editable);
45  }
46 
50  public static function hasLocalSet(int $ref_id, int $position_id): bool
51  {
52  if (self::getPermissionRepo()->find($ref_id, $position_id)) {
53  return true;
54  }
55 
56  return false;
57  }
58 
62  public static function getSetForRefId(int $ref_id, int $position_id): ilOrgUnitPermission
63  {
64  return self::getPermissionRepo()->getLocalorDefault($ref_id, $position_id);
65  }
66 
70  public static function findOrCreateSetForRefId(int $ref_id, int $position_id): ilOrgUnitPermission
71  {
72  return self::getPermissionRepo()->get($ref_id, $position_id);
73  }
74 
78  public static function removeLocalSetForRefId(int $ref_id, int $position_id): bool
79  {
80  return self::getPermissionRepo()->delete($ref_id, $position_id);
81  }
82 
86  public static function getAllTemplateSetsForAllActivedContexts(int $position_id, bool $editable = false): array
87  {
88  return self::getPermissionRepo()->getDefaultsForActiveContexts($position_id, $editable);
89  }
90 }
static hasLocalSet(int $ref_id, int $position_id)
static getTemplateSetForContextName(string $context_name, string $position_id, bool $editable=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static ilOrgUnitPermissionDBRepository $permissionRepo
static getSetForRefId(int $ref_id, int $position_id)
$ref_id
Definition: ltiauth.php:66
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static removeLocalSetForRefId(int $ref_id, int $position_id)
static findOrCreateSetForRefId(int $ref_id, int $position_id)
$dic
Definition: ltiresult.php:33
static getAllTemplateSetsForAllActivedContexts(int $position_id, bool $editable=false)