ENH replace permission checks with canView check on TestDBTask

This commit is contained in:
Andrew Paxley 2023-11-03 09:19:29 +13:00
parent 78444a44ca
commit 5d4327b238

View File

@ -23,15 +23,11 @@ class CleanupTestDatabasesTask extends BuildTask
public function run($request) public function run($request)
{ {
if (!Permission::check('ADMIN') && !Director::is_cli()) {
$response = Security::permissionFailure();
if ($response) {
$response->output();
}
die;
}
// Delete all temp DBs
TempDatabase::create()->deleteAll(); TempDatabase::create()->deleteAll();
} }
public function canView(): bool
{
return Permission::check('ADMIN') || Director::is_cli();
}
} }