ILIAS  trunk Revision v13.0_alpha-52-g21c366bbdd4
AccessControl.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS;
22
34
36{
37 public function init(
38 array | \ArrayAccess &$define,
39 array | \ArrayAccess &$implement,
40 array | \ArrayAccess &$use,
41 array | \ArrayAccess &$contribute,
42 array | \ArrayAccess &$seek,
43 array | \ArrayAccess &$provide,
44 array | \ArrayAccess &$pull,
45 array | \ArrayAccess &$internal,
46 ): void {
47 // Public surface
48 $define[] = Access::class;
49 $define[] = RBAC::class;
50
51 // Internal proxies (concrete classes — no interfaces)
52 $internal[UserIdProviderProxy::class] = static fn() => new UserIdProviderProxy();
53 $internal[RepositoryTreeAccessProxy::class] = static fn() => new RepositoryTreeAccessProxy();
54 $internal[ObjectDataAccessProxy::class] = static fn() => new ObjectDataAccessProxy();
55 $internal[ObjectDefinitionAccessProxy::class] = static fn() => new ObjectDefinitionAccessProxy();
56
57 // Internal RBAC services (legacy concrete classes)
58 $internal[\ilRbacReview::class] = static fn() => new \ilRbacReview(
59 $pull[Connection::class],
60 $use[\ILIAS\Logging\Logger\LoggerFactoryInterface::class]->getLazy('ac'),
61 );
62
63 $internal[\ilRbacSystem::class] = static fn() => new \ilRbacSystem(
64 $internal[UserIdProviderProxy::class],
65 $pull[Connection::class],
66 $internal[\ilRbacReview::class],
67 $internal[RepositoryTreeAccessProxy::class],
68 $use[GlobalHttpState::class],
69 $pull[\ILIAS\Refinery\Factory::class],
70 $internal[ObjectDataAccessProxy::class],
71 );
72
73 $internal[\ilRbacAdmin::class] = static fn() => new \ilRbacAdmin(
74 $pull[Connection::class],
75 $internal[\ilRbacReview::class],
76 $use[\ILIAS\Logging\Logger\LoggerFactoryInterface::class]->getLazy('ac'),
77 );
78
79 // Public implementations (in case of RBAC for legacy reasons only)
80 $implement[RBAC::class] = static fn() => new DefaultRBAC(
81 $internal[\ilRbacReview::class],
82 $internal[\ilRbacSystem::class],
83 $internal[\ilRbacAdmin::class],
84 );
85
86 $implement[Access::class] = static fn() => new \ilAccess(
87 $internal[UserIdProviderProxy::class],
88 $pull[Connection::class],
89 $internal[\ilRbacSystem::class],
90 $internal[RepositoryTreeAccessProxy::class],
91 $internal[ObjectDefinitionAccessProxy::class],
92 $use[\ILIAS\Logging\Logger\LoggerFactoryInterface::class]->getLazy('ac'),
93 );
94
95 // Setup agents and assets
96 $contribute[\ILIAS\Setup\Agent::class] = static fn() =>
97 new \ilAccessControlSetupAgent(
98 $pull[\ILIAS\Refinery\Factory::class]
99 );
100 $contribute[\ILIAS\Setup\Agent::class] = static fn() =>
101 new \ilAccessRBACSetupAgent(
102 $pull[\ILIAS\Refinery\Factory::class]
103 );
104 $contribute[Component\Resource\PublicAsset::class] = fn() =>
105 new Component\Resource\ComponentJS($this, "ilPermSelect.js");
106 $contribute[LanguageFileDirectory::class] = fn() => new ComponentLanguageFileDirectory(
107 $this,
108 'rbac'
109 );
110 }
111}
init(array|\ArrayAccess &$define, array|\ArrayAccess &$implement, array|\ArrayAccess &$use, array|\ArrayAccess &$contribute, array|\ArrayAccess &$seek, array|\ArrayAccess &$provide, array|\ArrayAccess &$pull, array|\ArrayAccess &$internal,)
This is a js file provided by some component.
Definition: ComponentJS.php:27
Public access-handling service of the AccessControl component.
Definition: Access.php:31
Public RBAC service of the AccessControl component.
Definition: RBAC.php:30
Wrapper for the Setup to work, as they require a namespace.
Definition: Connection.php:27
Interface GlobalHttpState.
A directory of language files with a path and a prefix for them.
A component is the most general form of an entity in the UI.
Definition: Component.php:28
Class ilObjLanguageAccess.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.