ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PermissionStandardAdapter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
25 public function __construct(
26 protected \ilAccess $access,
27 protected \ilRbacAdmin $rbacadmin,
28 protected TreeInterface $tree
29 ) {
30 }
31
32 public function checkAccess(string $operation, int $ref_id): bool
33 {
34 return $this->access->checkAccess($operation, "", $ref_id);
35 }
36
37 public function getRefIdsWithoutDeletePermission(array $ids): array
38 {
39 $not_deletable = [];
40 foreach ($ids as $id) {
41 if (!$this->access->checkAccess('delete', "", $id)) {
42 $not_deletable[] = (int) $id;
43 }
44
45 $node_data = $this->tree->getNodeData($id);
46 $subtree_nodes = $this->tree->getSubTree($node_data);
47
48 foreach ($subtree_nodes as $node) {
49 if ($node['type'] === 'rolf') {
50 continue;
51 }
52 if (!$this->access->checkAccess('delete', "", $node["child"])) {
53 $not_deletable[] = (int) $node["child"];
54 }
55 }
56 }
57 return $not_deletable;
58 }
59
60 public function revokePermission(int $ref_id): void
61 {
62 $this->rbacadmin->revokePermission($ref_id);
63 }
64}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
__construct(protected \ilAccess $access, protected \ilRbacAdmin $rbacadmin, protected TreeInterface $tree)
Class ilAccessHandler Checks access for ILIAS objects.
Class ilRbacAdmin Core functions for role based access control.
$ref_id
Definition: ltiauth.php:66
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...