mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT: Let LeftAndMain subclass canView() methods optionally redirect. (from r90018) (from r96800)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102663 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
81f5920228
commit
1dfe8f3a83
@ -125,7 +125,8 @@ class LeftAndMain extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Allow customisation of the access check by a decorator
|
// Allow customisation of the access check by a decorator
|
||||||
if(!$this->canView()) {
|
// Also all the canView() check to execute Director::redirect()
|
||||||
|
if(!$this->canView() && !$this->response->isFinished()) {
|
||||||
// When access /admin/, we should try a redirect to another part of the admin rather than be locked out
|
// When access /admin/, we should try a redirect to another part of the admin rather than be locked out
|
||||||
$menu = $this->MainMenu();
|
$menu = $this->MainMenu();
|
||||||
foreach($menu as $candidate) {
|
foreach($menu as $candidate) {
|
||||||
@ -152,7 +153,7 @@ class LeftAndMain extends Controller {
|
|||||||
|
|
||||||
return Security::permissionFailure($this, $messageSet);
|
return Security::permissionFailure($this, $messageSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't continue if there's already been a redirection request.
|
// Don't continue if there's already been a redirection request.
|
||||||
if(Director::redirected_to()) return;
|
if(Director::redirected_to()) return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user