CakePHP ACL gives error

前端 未结 1 1197
孤城傲影
孤城傲影 2021-01-28 21:35

I\'ve set this in my AppController.php

    $this->Auth->authorize = array(
    \'Actions\' => array(
        \'actionPath\' => \'controllers/\'
    )         


        
1条回答
  •  鱼传尺愫
    2021-01-28 22:14

    The user Test belongs the Aro 14 as seen in your Aro table. The parent_id field in the table Aro defines the tree.

    // For eg. If i have two groups Administrator, User
    Groups
    id | name
    11 | Administrator
    22 | User
    

    And Users // I have users table as

    id | name | group_id
     7 |  KK  |    11
     9 |  SS  |    22
    

    My Aro table would be

    ARO
    id | parent_id | alias | foreign_key  
     1 |   null    |  adm  |   11            // Group
     2 |   null    |  usr  |   22            // Group
     3 |    1      |  kk   |   7            // User
     4 |    2      |  SS   |   9            // User
    

    From your Aro/Acl setup, cake's ACL component is not able to find 14. If you want to make your life easier you can try Acl Plugin. This really simplifies some obvious tasks.

    0 讨论(0)
提交回复
热议问题