ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 $ilDB;
49
50 switch($a_context_type)
51 {
53 return array($_REQUEST["ref_id"]);
54
56 $set = $ilDB->query("SELECT field_id id".
57 " FROM udf_definition");
58 break;
59
60 default:
61 return array();
62 }
63
64 $res = array();
65 while($row = $ilDB->fetchAssoc($set))
66 {
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 $ilPluginAdmin;
119
120 $res = array();
121
122 foreach($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "User", "udfc") as $plugin_name)
123 {
124 $res[] = $ilPluginAdmin->getPluginObject(IL_COMP_SERVICE,
125 "User", "udfc", $plugin_name);
126 }
127
128 return $res;
129 }
130}
131
132?>
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)
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
global $ilDB