ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilOrgUnitPermissionQueries.php
Go to the documentation of this file.
1 <?php
2 
25 {
27 
28  protected static function getPermissionRepo()
29  {
30  if (!isset(self::$permissionRepo)) {
32  self::$permissionRepo = $dic["repo.Permissions"];
33  }
34 
35  return self::$permissionRepo;
36  }
37 
41  public static function getTemplateSetForContextName(string $context_name, string $position_id, bool $editable = false): ilOrgUnitPermission
42  {
43  return self::getPermissionRepo()->getDefaultForContext($context_name, (int) $position_id, $editable);
44  }
45 
49  public static function hasLocalSet(int $ref_id, int $position_id): bool
50  {
51  if (self::getPermissionRepo()->find($ref_id, $position_id)) {
52  return true;
53  }
54 
55  return false;
56  }
57 
61  public static function getSetForRefId(int $ref_id, int $position_id): ilOrgUnitPermission
62  {
63  return self::getPermissionRepo()->getLocalorDefault($ref_id, $position_id);
64  }
65 
69  public static function findOrCreateSetForRefId(int $ref_id, int $position_id): ilOrgUnitPermission
70  {
71  return self::getPermissionRepo()->get($ref_id, $position_id);
72  }
73 
77  public static function removeLocalSetForRefId(int $ref_id, int $position_id): bool
78  {
79  return self::getPermissionRepo()->delete($ref_id, $position_id);
80  }
81 
85  public static function getAllTemplateSetsForAllActivedContexts(int $position_id, bool $editable = false): array
86  {
87  return self::getPermissionRepo()->getDefaultsForActiveContexts($position_id, $editable);
88  }
89 }
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:65
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: result.php:31
static getAllTemplateSetsForAllActivedContexts(int $position_id, bool $editable=false)