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();
43 $this->base_permissions[$p[
"ops_id"]] = $p[
"operation"];
44 $this->base_permissions_by_op[$p[
"operation"]] = $p[
"ops_id"];
47 $this->base_roles = $rbacreview->getParentRoleIds($this->obj->getRefId());
58 foreach ($this->base_roles as $k =>
$r) {
59 $ops = $rbacreview->getActiveOperationsOfRole($this->obj->getRefId(),
$r[
"rol_id"]);
62 if (!in_array($o, $ops)) {
67 if (in_array($o, $ops)) {
86 if (is_array($a_val)) {
87 foreach ($a_val as $p) {
88 if (in_array($p, $this->base_permissions)) {
89 $this->role_required_permissions[] = $this->base_permissions_by_op[$p];
112 if (is_array($a_val)) {
113 foreach ($a_val as $p) {
114 if (in_array($p, $this->base_permissions)) {
115 $this->role_prohibited_permissions[] = $this->base_permissions_by_op[$p];
138 if (is_array($a_val)) {
139 foreach ($a_val as $p) {
140 if (in_array($p, $this->base_permissions)) {
141 $this->permissions[$this->base_permissions_by_op[$p]] = $p;
162 $cmd = $this->ctrl->getCmd(
"showForm");
163 if (in_array($cmd,
array(
"showForm",
"save"))) {
174 $this->tpl->setContent(
$form->getHTML());
185 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
190 foreach ($roles as
$r) {
191 $ops[$r[
"rol_id"]] = $rbacreview->getActiveOperationsOfRole($this->obj->getRefId(), $r[
"rol_id"]);
195 $perm_roles =
array();
196 foreach ($ops as $r => $o2) {
197 foreach ($o2 as $o) {
198 $perm_roles[$o][] =
$r;
203 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
208 foreach ($roles as $k => $r) {
210 $cb->addOption($option);
212 if (is_array($perm_roles[$this->base_permissions_by_op[$p]])) {
213 $cb->setValue($perm_roles[$this->base_permissions_by_op[$p]]);
218 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
220 $form->setTitle($this->lng->txt(
"rbac_permissions"));
221 $form->setFormAction($this->ctrl->getFormAction($this));
231 global $rbacreview, $rbacadmin;
234 if (
$form->checkInput()) {
237 $ops = $rbacreview->getActiveOperationsOfRole($this->obj->getRefId(),
$r[
"rol_id"]);
240 $rbacadmin->revokePermission($this->obj->getRefId(),
$r[
"rol_id"]);
244 $roles =
$form->getInput($p);
245 if (!is_array($roles)) {
248 $o = $this->base_permissions_by_op[$p];
251 if (in_array($o, $ops) && !in_array(
$r[
"rol_id"], $roles)) {
252 if ((
$key = array_search($o, $ops)) !==
false) {
258 if (!in_array($o, $ops) && in_array(
$r[
"rol_id"], $roles)) {
264 $rbacadmin->grantPermission(
267 $this->obj->getRefId()
272 $this->ctrl->redirect($this,
"");
274 $form->setValuesByPost();
275 $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
if(isset($_POST['submit'])) $form
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.
static _getTranslation($a_role_title)
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.