ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 include_once "Services/Component/classes/class.ilClaimingPermissionHelper.php";
5 
15 {
16  const CONTEXT_UDF = 1;
17  const CONTEXT_FIELD = 2;
18 
19 
21 
22  const ACTION_FIELD_EDIT = 1;
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  case self::CONTEXT_UDF:
52  return array($_REQUEST["ref_id"]);
53 
54  case self::CONTEXT_FIELD:
55  $set = $ilDB->query("SELECT field_id id" .
56  " FROM udf_definition");
57  break;
58 
59  default:
60  return array();
61  }
62 
63  $res = array();
64  while ($row = $ilDB->fetchAssoc($set)) {
65  $res[] = $row["id"];
66  }
67  return $res;
68  }
69 
70 
71  // permissions
72 
73  protected function buildPermissionMap()
74  {
75  return array(
76  self::CONTEXT_UDF => array(
77  "actions" => array(
78  self::ACTION_UDF_CREATE_FIELD
79  )
80  ),
81  self::CONTEXT_FIELD => array(
82  "actions" => array(
83  self::ACTION_FIELD_EDIT,
84  self::ACTION_FIELD_DELETE
85  ),
86  "subactions" => array(
87  self::ACTION_FIELD_EDIT_PROPERTY =>
88  array(
89  self::SUBACTION_FIELD_TITLE
90  ,self::SUBACTION_FIELD_PROPERTIES
91  )
92  ,self::ACTION_FIELD_EDIT_ACCESS =>
93  array(
94  self::SUBACTION_FIELD_ACCESS_VISIBLE_PERSONAL
95  ,self::SUBACTION_FIELD_ACCESS_VISIBLE_REGISTRATION
96  ,self::SUBACTION_FIELD_ACCESS_VISIBLE_LOCAL
97  ,self::SUBACTION_FIELD_ACCESS_VISIBLE_COURSES
98  ,self::SUBACTION_FIELD_ACCESS_VISIBLE_GROUPS
99  ,self::SUBACTION_FIELD_ACCESS_CHANGEABLE_PERSONAL
100  ,self::SUBACTION_FIELD_ACCESS_CHANGEABLE_LOCAL
101  ,self::SUBACTION_FIELD_ACCESS_REQUIRED
102  ,self::SUBACTION_FIELD_ACCESS_EXPORT
103  ,self::SUBACTION_FIELD_ACCESS_SEARCHABLE
104  ,self::SUBACTION_FIELD_ACCESS_CERTIFICATE
105  )
106  )
107  )
108  );
109  }
110 
111 
112  // plugins
113 
114  protected function getActivePlugins()
115  {
116  global $ilPluginAdmin;
117 
118  $res = array();
119 
120  foreach ($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "User", "udfc") as $plugin_name) {
121  $res[] = $ilPluginAdmin->getPluginObject(
123  "User",
124  "udfc",
125  $plugin_name
126  );
127  }
128 
129  return $res;
130  }
131 }
Claiming permission helper base class.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
$a_context_type
Definition: workflow.php:96
global $ilDB
const IL_COMP_SERVICE