diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php index 7d08bae04..71e95e3f6 100755 --- a/app/Controller/AppController.php +++ b/app/Controller/AppController.php @@ -394,14 +394,13 @@ class AppController extends Controller { $this->loadModel('Role'); $roles = $this->Role->find('all',array('recursive' => 0)); foreach ($roles as $role) { - $this->generateACL($role); + $this->_generateACL($role); } $this->Session->setFlash(__('All done.')); $this->redirect(array('controller' => 'events', 'action' => 'index', 'admin' => false)); } - public function generateACL($inc) { - if (!self::_isSiteAdmin()) throw new NotFoundException(); + public function _generateACL($inc) { if (!isset($inc['Role']['permission'])) $inc['Role']['permission'] = 0; switch ($inc['Role']['permission']) { case '0': diff --git a/app/Controller/RolesController.php b/app/Controller/RolesController.php index ebc06704f..ac614aaf6 100755 --- a/app/Controller/RolesController.php +++ b/app/Controller/RolesController.php @@ -65,7 +65,7 @@ class RolesController extends AppController { $this->Session->setFlash(__(sprintf('The Role has been saved.'))); $this->set('options', $this->options); $passAlong = $this->Role->read(null, $this->Role->getInsertID()); - $this->generateACL($passAlong); + $this->_generateACL($passAlong); $this->redirect(array('action' => 'index')); } else { if (!($this->Session->check('Message.flash'))) { @@ -99,7 +99,7 @@ class RolesController extends AppController { if($this->Auth->User('org') != 'ADMIN') $this->redirect(array('controller' => 'roles', 'action' => 'index', 'admin' => false)); $this->AdminCrud->adminEdit($id); $passAlong = $this->Role->read(null, $id); - $this->generateACL($passAlong); + $this->_generateACL($passAlong); $this->set('options', $this->options); }