mirror of https://github.com/MISP/MISP
fixes #141
parent
e2601d3623
commit
84b552fb74
|
@ -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':
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue