mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENH replace permission checks with canView check on TestDBTask
This commit is contained in:
parent
78444a44ca
commit
5d4327b238
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user