ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC;
49 
50  $ilDB = $DIC['ilDB'];
51 
52  switch ($a_context_type) {
53  case self::CONTEXT_UDF:
54  return array($_REQUEST["ref_id"]);
55 
56  case self::CONTEXT_FIELD:
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 }
Claiming permission helper base class.
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$row
$a_context_type
Definition: workflow.php:96
global $ilDB
const IL_COMP_SERVICE