ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPermission2GUI Class Reference

Class ilPermissionGUI RBAC related output. More...

+ Inheritance diagram for ilPermission2GUI:
+ Collaboration diagram for ilPermission2GUI:

Public Member Functions

 __construct (object $a_gui_obj)
 
 owner ()
 
 changeOwner ()
 
 __initSubTabs (string $a_cmd)
 
 log ()
 
 applyLogFilter ()
 
 resetLogFilter ()
 

Protected Attributes

object $gui_obj
 
ilErrorHandling $ilErr
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilObjectDefinition $objDefinition
 
ilGlobalTemplateInterface $tpl
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ilRbacAdmin $rbacadmin
 
ilObjectDataCache $objectDataCache
 
ilTabsGUI $tabs
 
GlobalHttpState $http
 
Factory $refinery
 

Private Attributes

const TAB_POSITION_PERMISSION_SETTINGS = "position_permission_settings"
 
array $roles = []
 
int $num_roles = 0
 

Detailed Description

Class ilPermissionGUI RBAC related output.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 30 of file class.ilPermission2GUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPermission2GUI::__construct ( object  $a_gui_obj)

Definition at line 51 of file class.ilPermission2GUI.php.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\tabs().

52  {
53  global $DIC;
54 
55  $this->objDefinition = $DIC['objDefinition'];
56  $this->objectDataCache = $DIC['ilObjDataCache'];
57  $this->tpl = $DIC->ui()->mainTemplate();
58  $this->lng = $DIC->language();
59  $this->lng->loadLanguageModule("rbac");
60  $this->ctrl = $DIC->ctrl();
61  $this->rbacsystem = $DIC->rbac()->system();
62  $this->rbacreview = $DIC->rbac()->review();
63  $this->rbacadmin = $DIC->rbac()->admin();
64  $this->tabs = $DIC->tabs();
65  $this->ilErr = $DIC['ilErr'];
66  $this->http = $DIC->http();
67  $this->refinery = $DIC->refinery();
68 
69  $this->gui_obj = $a_gui_obj;
70  $this->tabs->activateTab('perm_settings');
71  }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Member Function Documentation

◆ __initSubTabs()

ilPermission2GUI::__initSubTabs ( string  $a_cmd)

Definition at line 131 of file class.ilPermission2GUI.php.

References $log, ilPermissionGUI\CMD_PERM_POSITIONS, ILIAS\Repository\ctrl(), ilOrgUnitGlobalSettings\getInstance(), ilRbacLog\isActive(), and ILIAS\Repository\tabs().

Referenced by ilPermissionGUI\executeCommand(), log(), owner(), ilPermissionGUI\perm(), ilPermissionGUI\permPositions(), and ilPermissionGUI\savePositionsPermissions().

131  : void
132  {
133  $perm = $a_cmd === 'perm';
134  $perm_positions = $a_cmd === ilPermissionGUI::CMD_PERM_POSITIONS;
135  $info = $a_cmd === 'perminfo';
136  $owner = $a_cmd === 'owner';
137  $log = $a_cmd === 'log';
138 
139  $this->tabs->addSubTabTarget(
140  "permission_settings",
141  $this->ctrl->getLinkTarget($this, "perm"),
142  "",
143  "",
144  "",
145  $perm
146  );
147 
148  if (ilOrgUnitGlobalSettings::getInstance()->isPositionAccessActiveForObject($this->gui_obj->getObject()->getId())) {
149  $this->tabs->addSubTabTarget(
150  self::TAB_POSITION_PERMISSION_SETTINGS,
151  $this->ctrl->getLinkTarget($this, ilPermissionGUI::CMD_PERM_POSITIONS),
152  "",
153  "",
154  "",
155  $perm_positions
156  );
157  }
158 
159  $this->tabs->addSubTabTarget(
160  "info_status_info",
161  $this->ctrl->getLinkTargetByClass(array(get_class($this), "ilobjectpermissionstatusgui"), "perminfo"),
162  "",
163  "",
164  "",
165  $info
166  );
167  $this->tabs->addSubTabTarget(
168  "owner",
169  $this->ctrl->getLinkTarget($this, "owner"),
170  "",
171  "",
172  "",
173  $owner
174  );
175 
176  if (ilRbacLog::isActive()) {
177  $this->tabs->addSubTabTarget(
178  "rbac_log",
179  $this->ctrl->getLinkTarget($this, "log"),
180  "",
181  "",
182  "",
183  $log
184  );
185  }
186  }
static isActive()
$log
Definition: result.php:33
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyLogFilter()

ilPermission2GUI::applyLogFilter ( )

Definition at line 200 of file class.ilPermission2GUI.php.

References log(), and ilTable2GUI\resetOffset().

200  : void
201  {
202  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->getObject()->getRefId());
203  $table->resetOffset();
204  $table->writeFilterToSession();
205  $this->log();
206  }
resetOffset(bool $a_in_determination=false)
Class ilRbacLogTableGUI.
+ Here is the call graph for this function:

◆ changeOwner()

ilPermission2GUI::changeOwner ( )

Definition at line 95 of file class.ilPermission2GUI.php.

References ilObjUser\_lookupId(), ilRbacLog\add(), ilRbacLog\CHANGE_OWNER, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ilRbacLog\isActive(), ILIAS\Repository\lng(), owner(), and ILIAS\Repository\refinery().

95  : void
96  {
97  $owner = '';
98  if ($this->http->wrapper()->post()->has('owner')) {
99  $owner = $this->http->wrapper()->post()->retrieve(
100  'owner',
101  $this->refinery->kindlyTo()->string()
102  );
103  }
104  if (!$user_id = ilObjUser::_lookupId($owner)) {
105  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('user_not_known'));
106  $this->owner();
107  return;
108  }
109 
110  // no need to change?
111  if ($user_id != $this->gui_obj->getObject()->getOwner()) {
112  $this->gui_obj->getObject()->setOwner($user_id);
113  $this->gui_obj->getObject()->updateOwner();
114  $this->objectDataCache->deleteCachedEntry($this->gui_obj->getObject()->getId());
115 
116  if (ilRbacLog::isActive()) {
117  ilRbacLog::add(ilRbacLog::CHANGE_OWNER, $this->gui_obj->getObject()->getRefId(), array($user_id));
118  }
119  }
120 
121  $this->tpl->setOnScreenMessage('success', $this->lng->txt('owner_updated'), true);
122 
123  if (!$this->rbacsystem->checkAccess("edit_permission", $this->gui_obj->getObject()->getRefId())) {
124  $this->ctrl->redirect($this->gui_obj);
125  return;
126  }
127  $this->ctrl->redirect($this, 'owner');
128  }
const CHANGE_OWNER
static _lookupId($a_user_str)
static isActive()
static http()
Fetches the global http state from ILIAS.
static add(int $a_action, int $a_ref_id, array $a_diff, bool $a_source_ref_id=false)
+ Here is the call graph for this function:

◆ log()

ilPermission2GUI::log ( )

Definition at line 188 of file class.ilPermission2GUI.php.

References __initSubTabs(), ILIAS\Repository\ctrl(), and ilRbacLog\isActive().

Referenced by applyLogFilter(), and resetLogFilter().

188  : void
189  {
190  if (!ilRbacLog::isActive()) {
191  $this->ctrl->redirect($this, "perm");
192  }
193 
194  $this->__initSubTabs("log");
195 
196  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->getObject()->getRefId());
197  $this->tpl->setContent($table->getHTML());
198  }
static isActive()
__initSubTabs(string $a_cmd)
Class ilRbacLogTableGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ owner()

ilPermission2GUI::owner ( )

Definition at line 74 of file class.ilPermission2GUI.php.

References __initSubTabs(), ilObjUser\_lookupLogin(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by changeOwner().

74  : void
75  {
76  $this->__initSubTabs("owner");
77 
78  $form = new ilPropertyFormGUI();
79  $form->setFormAction($this->ctrl->getFormAction($this, "owner"));
80  $form->setTitle($this->lng->txt("info_owner_of_object"));
81 
82  $login = new ilTextInputGUI($this->lng->txt("login"), "owner");
83  $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this),
84  'ilRepositorySearchGUI'
85  ), 'doUserAutoComplete', '', true));
86  $login->setRequired(true);
87  $login->setSize(50);
88  $login->setInfo($this->lng->txt("chown_warning"));
89  $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->getObject()->getOwner()));
90  $form->addItem($login);
91  $form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
92  $this->tpl->setContent($form->getHTML());
93  }
__initSubTabs(string $a_cmd)
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetLogFilter()

ilPermission2GUI::resetLogFilter ( )

Definition at line 208 of file class.ilPermission2GUI.php.

References log(), and ilTable2GUI\resetOffset().

208  : void
209  {
210  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->getObject()->getRefId());
211  $table->resetOffset();
212  $table->resetFilter();
213  $this->log();
214  }
resetOffset(bool $a_in_determination=false)
Class ilRbacLogTableGUI.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilPermission2GUI::$ctrl
protected

Definition at line 36 of file class.ilPermission2GUI.php.

◆ $gui_obj

object ilPermission2GUI::$gui_obj
protected

Definition at line 34 of file class.ilPermission2GUI.php.

◆ $http

GlobalHttpState ilPermission2GUI::$http
protected

Definition at line 45 of file class.ilPermission2GUI.php.

◆ $ilErr

ilErrorHandling ilPermission2GUI::$ilErr
protected

Definition at line 35 of file class.ilPermission2GUI.php.

◆ $lng

ilLanguage ilPermission2GUI::$lng
protected

Definition at line 37 of file class.ilPermission2GUI.php.

◆ $num_roles

int ilPermission2GUI::$num_roles = 0
private

Definition at line 49 of file class.ilPermission2GUI.php.

◆ $objDefinition

ilObjectDefinition ilPermission2GUI::$objDefinition
protected

◆ $objectDataCache

ilObjectDataCache ilPermission2GUI::$objectDataCache
protected

Definition at line 43 of file class.ilPermission2GUI.php.

◆ $rbacadmin

ilRbacAdmin ilPermission2GUI::$rbacadmin
protected

Definition at line 42 of file class.ilPermission2GUI.php.

Referenced by ilPermissionGUI\savePermissions().

◆ $rbacreview

ilRbacReview ilPermission2GUI::$rbacreview
protected

◆ $rbacsystem

ilRbacSystem ilPermission2GUI::$rbacsystem
protected

Definition at line 40 of file class.ilPermission2GUI.php.

◆ $refinery

Factory ilPermission2GUI::$refinery
protected

Definition at line 46 of file class.ilPermission2GUI.php.

◆ $roles

array ilPermission2GUI::$roles = []
private

◆ $tabs

ilTabsGUI ilPermission2GUI::$tabs
protected

Definition at line 44 of file class.ilPermission2GUI.php.

◆ $tpl

ilGlobalTemplateInterface ilPermission2GUI::$tpl
protected

Definition at line 39 of file class.ilPermission2GUI.php.

◆ TAB_POSITION_PERMISSION_SETTINGS

const ilPermission2GUI::TAB_POSITION_PERMISSION_SETTINGS = "position_permission_settings"
private

Definition at line 32 of file class.ilPermission2GUI.php.


The documentation for this class was generated from the following file: