30 $this->objDefinition = $objDefinition;
33 $this->lng->loadLanguageModule(
"rbac");
37 $this->gui_obj = $a_gui_obj;
38 $this->obj = $a_gui_obj->object;
39 $this->red_id = $this->obj->getRefId();
44 $this->base_permissions[$p[
"ops_id"]] = $p[
"operation"];
45 $this->base_permissions_by_op[$p[
"operation"]] = $p[
"ops_id"];
48 $this->base_roles = $rbacreview->getParentRoleIds($this->obj->getRefId());
59 foreach ($this->base_roles as $k =>
$r)
61 $ops = $rbacreview->getActiveOperationsOfRole($this->obj->getRefId(),
$r[
"rol_id"]);
65 if (!in_array($o, $ops))
72 if (in_array($o, $ops))
95 foreach ($a_val as $p)
97 if (in_array($p, $this->base_permissions))
99 $this->role_required_permissions[] = $this->base_permissions_by_op[$p];
122 if (is_array($a_val))
124 foreach ($a_val as $p)
126 if (in_array($p, $this->base_permissions))
128 $this->role_prohibited_permissions[] = $this->base_permissions_by_op[$p];
151 if (is_array($a_val))
153 foreach ($a_val as $p)
155 if (in_array($p, $this->base_permissions))
157 $this->permissions[$this->base_permissions_by_op[$p]] = $p;
178 $cmd = $this->ctrl->getCmd(
"showForm");
179 if (in_array(
$cmd,
array(
"showForm",
"save")))
191 $this->tpl->setContent($form->getHTML());
202 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
207 foreach ($roles as
$r)
209 $ops[$r[
"rol_id"]] = $rbacreview->getActiveOperationsOfRole($this->obj->getRefId(), $r[
"rol_id"]);
213 $perm_roles =
array();
214 foreach ($ops as $r => $o2)
218 $perm_roles[$o][] =
$r;
228 foreach ($roles as $k => $r)
231 $cb->addOption($option);
233 if (is_array($perm_roles[$this->base_permissions_by_op[$p]]))
235 $cb->setValue($perm_roles[$this->base_permissions_by_op[$p]]);
241 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
243 $form->setTitle($this->lng->txt(
"rbac_permissions"));
244 $form->setFormAction($this->ctrl->getFormAction($this));
254 global $rbacreview, $rbacadmin;
257 if ($form->checkInput())
262 $ops = $rbacreview->getActiveOperationsOfRole($this->obj->getRefId(),
$r[
"rol_id"]);
265 $rbacadmin->revokePermission($this->obj->getRefId(),
$r[
"rol_id"]);
270 $roles = $form->getInput($p);
271 if (!is_array($roles))
275 $o = $this->base_permissions_by_op[$p];
278 if (in_array($o, $ops) && !in_array(
$r[
"rol_id"], $roles))
280 if(($key = array_search($o, $ops)) !==
false) {
286 if (!in_array($o, $ops) && in_array(
$r[
"rol_id"], $roles))
293 $rbacadmin->grantPermission(
296 $this->obj->getRefId()
301 $this->ctrl->redirect($this,
"");
305 $form->setValuesByPost();
306 $this->tpl->setContent($form->getHtml());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
UI class for handling permissions that can be configured having the write permission for an object...
$role_prohibited_permissions
$role_required_permissions
This class represents an option in a checkbox group.
determineRoles()
Determine roles.
initPermissionForm()
Init permission form.
setPermissions($a_val)
Set permissions.
static _getOperationList($a_type=null)
get operation list by object type public static
setRoleRequiredPermissions($a_val)
Set role required permissions (this permissions are required for a role to be listed) ...
setRoleProhibitedPermissions($a_val)
Set role prohibited permissions (this permissions are prohibited for a role to be listed) ...
getRoleProhibitedPermissions()
Get role prohibited permissions.
Create styles array
The data for the language used.
getRoleRequiredPermissions()
Get role required permissions.
getPermissions()
Get permissions.
executeCommand()
Execute command.
__construct($a_gui_obj)
Constructor.