multiple prefix routing in cakePHP
-
04-10-2020 - |
문제
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???
해결책
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.
다른 팁
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');
...
제휴하지 않습니다 StackOverflow