File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,6 @@ public function __construct(
3131 ) {
3232 }
3333
34- public function isSspAdmin (): bool
35- {
36- return $ this ->sspBridge ->utils ()->auth ()->isAdmin ();
37- }
38-
3934 /**
4035 * @throws \SimpleSAML\Error\Exception
4136 * @throws \Exception
@@ -57,8 +52,6 @@ public function getAuthUserId(): string
5752 */
5853 public function requirePermission (string $ neededPermission ): void
5954 {
60- $ auth = $ this ->authenticate ();
61-
6255 $ permissions = $ this ->moduleConfig
6356 ->config ()
6457 ->getOptionalConfigItem (ModuleConfig::OPTION_ADMIN_UI_PERMISSIONS , null );
@@ -69,6 +62,9 @@ public function requirePermission(string $neededPermission): void
6962 if (!$ permissions ->hasValue ($ neededPermission )) {
7063 throw new RuntimeException ('No permission defined for ' . $ neededPermission );
7164 }
65+
66+ $ auth = $ this ->authenticate ();
67+
7268 $ attributeName = $ permissions ->getString ('attribute ' );
7369 /** @var string[] $entitlements */
7470 $ entitlements = $ auth ->getAttributes ()[$ attributeName ] ?? [];
You can’t perform that action at this time.
0 commit comments