Skip to content

Commit cc0eef6

Browse files
committed
add startWithCacheProvider
1 parent 1480987 commit cc0eef6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/Ubiquity/security/acl/AclManager.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ public static function start(): void {
4545
self::$aclList = new AclList();
4646
self::$aclList->init();
4747
}
48+
49+
/**
50+
* Start the Acls with AclCacheProvider (for attributes or annotations).
51+
*/
52+
public static function startWithCacheProvider(): void {
53+
self::start();
54+
self::initFromProviders([new AclCacheProvider()]);
55+
}
4856

4957
/**
5058
* Check whether the Acl service is started.

src/tests/unit/AclCacheProviderTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ protected function _before() {
2020
]
2121
];
2222
CacheManager::startProd($config);
23-
AclManager::start();
24-
AclManager::initFromProviders([
25-
new AclCacheProvider()
26-
]);
23+
AclManager::startWithCacheProvider();
2724
}
2825

2926
/**

0 commit comments

Comments
 (0)