ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilUDFPermissionHelper.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once "Services/Component/classes/class.ilClaimingPermissionHelper.php";
5
15{
16 const CONTEXT_UDF = 1;
17 const CONTEXT_FIELD = 2;
18
19
21
26
27
30
42
43
44 // caching
45
46 protected function readContextIds($a_context_type)
47 {
48 global $DIC;
49
50 $ilDB = $DIC['ilDB'];
51
52 switch ($a_context_type) {
54 return array($_REQUEST["ref_id"]);
55
57 $set = $ilDB->query("SELECT field_id id" .
58 " FROM udf_definition");
59 break;
60
61 default:
62 return array();
63 }
64
65 $res = array();
66 while ($row = $ilDB->fetchAssoc($set)) {
67 $res[] = $row["id"];
68 }
69 return $res;
70 }
71
72
73 // permissions
74
75 protected function buildPermissionMap()
76 {
77 return array(
78 self::CONTEXT_UDF => array(
79 "actions" => array(
80 self::ACTION_UDF_CREATE_FIELD
81 )
82 ),
83 self::CONTEXT_FIELD => array(
84 "actions" => array(
85 self::ACTION_FIELD_EDIT,
86 self::ACTION_FIELD_DELETE
87 ),
88 "subactions" => array(
89 self::ACTION_FIELD_EDIT_PROPERTY =>
90 array(
91 self::SUBACTION_FIELD_TITLE
92 ,self::SUBACTION_FIELD_PROPERTIES
93 )
94 ,self::ACTION_FIELD_EDIT_ACCESS =>
95 array(
96 self::SUBACTION_FIELD_ACCESS_VISIBLE_PERSONAL
97 ,self::SUBACTION_FIELD_ACCESS_VISIBLE_REGISTRATION
98 ,self::SUBACTION_FIELD_ACCESS_VISIBLE_LOCAL
99 ,self::SUBACTION_FIELD_ACCESS_VISIBLE_COURSES
100 ,self::SUBACTION_FIELD_ACCESS_VISIBLE_GROUPS
101 ,self::SUBACTION_FIELD_ACCESS_CHANGEABLE_PERSONAL
102 ,self::SUBACTION_FIELD_ACCESS_CHANGEABLE_LOCAL
103 ,self::SUBACTION_FIELD_ACCESS_REQUIRED
104 ,self::SUBACTION_FIELD_ACCESS_EXPORT
105 ,self::SUBACTION_FIELD_ACCESS_SEARCHABLE
106 ,self::SUBACTION_FIELD_ACCESS_CERTIFICATE
107 )
108 )
109 )
110 );
111 }
112
113
114 // plugins
115
116 protected function getActivePlugins()
117 {
118 global $DIC;
119
120 $ilPluginAdmin = $DIC['ilPluginAdmin'];
121
122 $res = array();
123
124 foreach ($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "User", "udfc") as $plugin_name) {
125 $res[] = $ilPluginAdmin->getPluginObject(
127 "User",
128 "udfc",
129 $plugin_name
130 );
131 }
132
133 return $res;
134 }
135}
An exception for terminatinating execution or to throw for unit testing.
const IL_COMP_SERVICE
Claiming permission helper base class.
readContextIds($a_context_type)
Get all context ids for context type (from DB, is cached)
buildPermissionMap()
Build map of context and actions.
getActivePlugins()
Get active plugins (for current slot)
global $DIC
Definition: goto.php:24
foreach($_POST as $key=> $value) $res
global $ilDB