ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilUDFPermissionHelper.php
Go to the documentation of this file.
1<?php
2
24{
25 public const CONTEXT_UDF = 1;
26 public const CONTEXT_FIELD = 2;
27
28 public const ACTION_UDF_CREATE_FIELD = 1;
29
30 public const ACTION_FIELD_EDIT = 1;
31 public const ACTION_FIELD_DELETE = 2;
33 public const ACTION_FIELD_EDIT_ACCESS = 4;
34
35 public const SUBACTION_FIELD_TITLE = 1;
37
50
51 // caching
52
53 protected function readContextIds(int $a_context_type): array // Missing array type.
54 {
55 global $DIC;
56
57 $ilDB = $DIC['ilDB'];
58
59 switch ($a_context_type) {
61 return [$this->getRefId()];
62
64 $set = $ilDB->query("SELECT field_id id" .
65 " FROM udf_definition");
66 break;
67
68 default:
69 return [];
70 }
71
72 $res = [];
73 while ($row = $ilDB->fetchAssoc($set)) {
74 $res[] = $row["id"];
75 }
76 return $res;
77 }
78
79
80 // permissions
81
82 protected function buildPermissionMap(): array // Missing array type.
83 {
84 return [
85 self::CONTEXT_UDF => [
86 "actions" => [
88 ]
89 ],
90 self::CONTEXT_FIELD => [
91 "actions" => [
94 ],
95 "subactions" => [
96 self::ACTION_FIELD_EDIT_PROPERTY =>
97 [
100 ]
101 ,self::ACTION_FIELD_EDIT_ACCESS =>
102 [
115 ]
116 ]
117 ]
118 ];
119 }
120
121
122 // plugins
123
124 protected function getActivePlugins(): Generator // Missing array type.
125 {
126 global $DIC;
127 $component_factory = $DIC["component.factory"];
128 yield from $component_factory->getActivePluginsInSlot("udfc");
129 }
130}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildPermissionMap()
Build map of context and actions.
readContextIds(int $a_context_type)
Get all context ids for context type (from DB, is cached)
getActivePlugins()
Get active plugins (for current slot)
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:26