diff options
author | Carl Schwan <carl@carlschwan.eu> | 2021-07-22 11:41:29 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2021-09-29 21:43:31 +0200 |
commit | 6958d8005ae3b86759f49746564bf7238456be52 (patch) | |
tree | aab851e09351c631129e4729aa49c03533ce6180 /apps/settings/tests/Middleware | |
parent | ee987d74303cb38b864f96660cd2ee6d6552ebfd (diff) | |
download | nextcloud-server-6958d8005ae3b86759f49746564bf7238456be52.tar.gz nextcloud-server-6958d8005ae3b86759f49746564bf7238456be52.zip |
Add admin privilege delegation for admin settings
This makes it possible for selected groups to access some settings
pages.
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/settings/tests/Middleware')
-rw-r--r-- | apps/settings/tests/Middleware/SubadminMiddlewareTest.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/settings/tests/Middleware/SubadminMiddlewareTest.php b/apps/settings/tests/Middleware/SubadminMiddlewareTest.php index d943e8ad752..a6317173439 100644 --- a/apps/settings/tests/Middleware/SubadminMiddlewareTest.php +++ b/apps/settings/tests/Middleware/SubadminMiddlewareTest.php @@ -68,10 +68,15 @@ class SubadminMiddlewareTest extends \Test\TestCase { $this->expectException(\OC\AppFramework\Middleware\Security\Exceptions\NotAdminException::class); $this->reflector - ->expects($this->once()) + ->expects($this->at(0)) ->method('hasAnnotation') ->with('NoSubAdminRequired') ->willReturn(false); + $this->reflector + ->expects($this->at(1)) + ->method('hasAnnotation') + ->with('AuthorizedAdminSetting') + ->willReturn(false); $this->subadminMiddleware->beforeController($this->controller, 'foo'); } @@ -87,10 +92,15 @@ class SubadminMiddlewareTest extends \Test\TestCase { public function testBeforeControllerAsSubAdminWithoutExemption() { $this->reflector - ->expects($this->once()) + ->expects($this->at(0)) ->method('hasAnnotation') ->with('NoSubAdminRequired') ->willReturn(false); + $this->reflector + ->expects($this->at(1)) + ->method('hasAnnotation') + ->with('AuthorizedAdminSetting') + ->willReturn(false); $this->subadminMiddlewareAsSubAdmin->beforeController($this->controller, 'foo'); } |