cakephp如何设置ACL权限

时间:2015-03-03 04:19:12

标签: cakephp

我正在使用cakephp 2.x版本。

我已经完成了Simple Acl控制的应用程序http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html

但我陷入Simple Acl控制的应用程序 - 第2部分http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/part-two.html

我已下载AclExtras插件并运行./Console/cake AclExtras.AclExtras aco_sync命令。

我的命令行输出是:

D:\xampp\htdocs\SIMPLE_ACL_APP\app>cake acl create aco root controllers


Welcome to CakePHP v2.6.1 Console
---------------------------------------------------------------
App : app
Path: D:\xampp\htdocs\SIMPLE_ACL_APP\app\
---------------------------------------------------------------
New Aco 'controllers' created.



D:\xampp\htdocs\SIMPLE_ACL_APP\app>cake AclExtras.AclExtras aco_sync


Welcome to CakePHP v2.6.1 Console
---------------------------------------------------------------
App : app
Path: D:\xampp\htdocs\SIMPLE_ACL_APP\app\
---------------------------------------------------------------
Created Aco node: controllers/Groups
Created Aco node: controllers/Groups/index
Created Aco node: controllers/Groups/view
Created Aco node: controllers/Groups/add
Created Aco node: controllers/Groups/edit
Created Aco node: controllers/Groups/delete
Created Aco node: controllers/Pages
Created Aco node: controllers/Pages/display
Created Aco node: controllers/Posts
Created Aco node: controllers/Posts/index
Created Aco node: controllers/Posts/view
Created Aco node: controllers/Posts/add
Created Aco node: controllers/Posts/edit
Created Aco node: controllers/Posts/delete
Created Aco node: controllers/Users
Created Aco node: controllers/Users/initDB
Created Aco node: controllers/Users/login
Created Aco node: controllers/Users/logout
Created Aco node: controllers/Users/index
Created Aco node: controllers/Users/view
Created Aco node: controllers/Users/add
Created Aco node: controllers/Users/edit
Created Aco node: controllers/Users/delete
Created Aco node: controllers/Widgets
Created Aco node: controllers/Widgets/index
Created Aco node: controllers/Widgets/view
Created Aco node: controllers/Widgets/add
Created Aco node: controllers/Widgets/edit
Created Aco node: controllers/Widgets/delete
Created Aco node: controllers/AclExtras
Aco Update Complete

我已经看到了权限,但无法执行设置权限

See documentcake acl命令对我不起作用。

请帮帮我。

1 个答案:

答案 0 :(得分:0)

从你的htdocs / app文件夹运行以下命令(例如):

Console/cake acl grant NameOfYourUserGroup controllers

'grant'后使用-h选项解释了这一点。 如果您看到“未授予Persmission”错误,那么您的参数可能错误,或者引用的ARO或ACO不存在。