pull/195/head
Christophe Vandeplas 2013-07-26 08:17:33 +02:00
parent e2601d3623
commit 84b552fb74
2 changed files with 4 additions and 5 deletions

View File

@ -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':

View File

@ -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);
}