multiple prefix routing in cakePHP
-
04-10-2020 - |
Pregunta
I have a new project with 4 users and some tasks which is only allowed to certain users.
Since the users and tasks are fixed i thought no need of using ACL.
is my decision is correct??
Then can i have multiple prefix for each users if yes how can i achive it??
I need to restrict the task of user A from user B how can i achive it???
Solución
4 users is also a list. I would suggest you to use the INI-based ACL component if you don't need to change permissions on the fly.
Otros consejos
Not especially elegant, but it should get the job done (in each relevant app_controller):
function beforeFilter()
{
parent::beforeFilter();
$currentUser = $this->Auth->user();
$uName = $currentUser['User']['username'];
switch($uName){
case 'User_1':
$this->Auth->allow('myAction');
...
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow