Skip to content

Instantly share code, notes, and snippets.

@hewerthomn
Created May 9, 2013 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hewerthomn/5550336 to your computer and use it in GitHub Desktop.
Save hewerthomn/5550336 to your computer and use it in GitHub Desktop.
exemplo de chamada do plugin Acl + Auth
<?php
/**
* arquivo AppController.php
*/
public $components = array(
/* outros componentes chamados aqui */
'Acl',
'Auth' => array(
'authError' => 'O usuário não tem permissão para acessar essa ação',
'loginRedirect' => array('controller' => 'pessoas', 'action' => 'inicio', 'admin' => false, 'plugin'=>null),
'logoutRedirect' => array('controller' => 'pessoas', 'action' => 'entrar', 'admin' => false, 'plugin'=>null),
'loginAction' => array('controller' => 'pessoas', 'action' => 'entrar', 'admin' => false, 'plugin'=>null),
'authorize' => array(
'Actions' => array('actionPath' => 'controllers')
),
'authenticate' => array(
'Form' => array(
'userModel' => 'Pessoa',
'fields' => array('username' => 'cpf'),
'scope' => array('Pessoa.active' => ATIVO)
)
)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment