Created
February 9, 2014 19:18
-
-
Save marcincodes/8904554 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function beforeFilter() { | |
parent::beforeFilter(); | |
$this->Auth->allow('initDB'); // We can remove this line after we're finished | |
} | |
public function initDB() { | |
$group = $this->User->Group; | |
// Allow admins to everything | |
$group->id = 1; | |
$this->Acl->allow($group, 'controllers'); | |
// allow users to only add and edit on posts and widgets | |
$group->id = 3; | |
$this->Acl->deny($group, 'controllers'); | |
// allow basic users to log out | |
$this->Acl->allow($group, 'controllers/users/logout'); | |
// we add an exit to avoid an ugly "missing views" error message | |
echo "all done"; | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment