mirror of
https://github.com/silverstripe/silverstripe-environmentcheck
synced 2024-10-22 17:05:40 +02:00
Merge pull request #15 from halkyon/permission-check
Allow specifying the permission for dev/check
This commit is contained in:
commit
98126dc448
@ -6,10 +6,15 @@ class DevCheckController extends Controller {
|
|||||||
'index'
|
'index'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Permission code to check for access to this controller.
|
||||||
|
*/
|
||||||
|
private static $permission = 'ADMIN';
|
||||||
|
|
||||||
function index($request) {
|
function index($request) {
|
||||||
$suiteName = $request->param('Suite') ? $request->param('Suite') : 'check';
|
$suiteName = $request->param('Suite') ? $request->param('Suite') : 'check';
|
||||||
$e = new EnvironmentChecker($suiteName, 'Environment status');
|
$e = new EnvironmentChecker($suiteName, 'Environment status');
|
||||||
$e->init('ADMIN'); //check for admin permissions before running this check
|
$e->init($this->config()->permission); //check for admin permissions before running this check
|
||||||
return $e;
|
return $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user