Skip to content

Commit

Permalink
ENH use init_permissions to match core PR
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewandante committed Oct 31, 2023
1 parent addf529 commit b47487d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Dev/DevelopmentAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ class DevelopmentAdmin extends Controller implements PermissionProvider
'$Action' => 'runRegisteredController',
];

private static $init_permissions = [
'ADMIN',
'ALL_DEV_ADMIN',
'CAN_DEV_GRAPHQL',
];

protected function init()
{
parent::init();
Expand Down Expand Up @@ -104,7 +110,7 @@ public function canInit(): bool
// We need to ensure that DevelopmentAdminTest can simulate permission failures when running
// "dev/tasks" from CLI.
|| (Director::is_cli() && RootDevelopmentAdmin::config()->get('allow_all_cli'))
|| Permission::check(['ADMIN', 'ALL_DEV_ADMIN', 'CAN_DEV_GRAPHQL'])
|| Permission::check(static::config()->get('init_permissions'))
);
}

Expand Down

0 comments on commit b47487d

Please sign in to comment.