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:
Ingo Schommer 2010-04-13 03:26:55 +00:00
parent 81f5920228
commit 1dfe8f3a83

View File

@ -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) {