Acl-cakePHP中组的共同权限

时间:2022-10-20 15:52:52

I am using Acl in new web app.
in my app there are four groups of users.
I have given $this->Auth->authorize = 'actions' so that it will check the permission for actions automatically.

我在新的网络应用程序中使用Acl。在我的应用程序中有四组用户。我给了$ this-> Auth-> authorize ='actions',以便它自动检查动作的权限。

my problem is some of the actions such as change Password,edit profile,etc...
are common to all users.
But now i need to create each record for the permission of each users in acos_aros table.
this is too annoying

我的问题是一些操作,如更改密码,编辑配置文件等...对所有用户都是通用的。但现在我需要为acos_aros表中的每个用户创建每条记录的权限。这太烦人了

1) Is there any way to give permission to all types of users with a single allow statement?
2) Is there any way to allow and deny user by checking whether parameter is passed or not?
that means i need to give permission to pass parameter to an action for a specific user. If any other user pass the parameter and try to access the data i need to deny them.

1)有没有办法通过一个允许语句向所有类型的用户授予权限? 2)有没有办法通过检查参数是否通过来允许和拒绝用户?这意味着我需要授予将参数传递给特定用户的操作的权限。如果任何其他用户传递参数并尝试访问我需要拒绝它们的数据。

whether row level access control can be done with ACL?

是否可以使用ACL完成行级访问控制?

Any help will be appreciated.
Thankz in advance :)

任何帮助将不胜感激。提前谢谢:)

2 个解决方案

#1


2  

  1. If you put a $this->Auth->allow('action1','action2'...) into your beforeFilter() of the controller, access is granted to all users. If you need an ACL-only solution, you have to create a parent aco to which all other acos you want to allow are children. Then grant your users the rights on the parent. The ACL plugin from the bakery could come in handy, if you already have your ACL tree structure. For building the ACL tree structure the build_acl() script in the tutorial at the end of the cake-manual is useful.

    如果将$ this-> Auth-> allow('action1','action2'...)放入控制器的beforeFilter(),则授予所有用户访问权限。如果您需要仅限ACL的解决方案,则必须创建一个父级aco,您要允许的所有其他acos都是子级。然后授予您的用户父母的权利。如果您已经拥有ACL树结构,面包店的ACL插件可以派上用场。为了构建ACL树结构,在蛋糕手册末尾的教程中的build_acl()脚本很有用。

  2. Allowing to pass the parameter for all users and checking their role in the action is not an option?

    允许为所有用户传递参数并检查他们在操作中的角色是不是一个选项?

#2


0  

the solution for the 2nd problem is here
but this is not implemented using ACL :(

第二个问题的解决方案在这里,但这不是使用ACL实现的:(

#1


2  

  1. If you put a $this->Auth->allow('action1','action2'...) into your beforeFilter() of the controller, access is granted to all users. If you need an ACL-only solution, you have to create a parent aco to which all other acos you want to allow are children. Then grant your users the rights on the parent. The ACL plugin from the bakery could come in handy, if you already have your ACL tree structure. For building the ACL tree structure the build_acl() script in the tutorial at the end of the cake-manual is useful.

    如果将$ this-> Auth-> allow('action1','action2'...)放入控制器的beforeFilter(),则授予所有用户访问权限。如果您需要仅限ACL的解决方案,则必须创建一个父级aco,您要允许的所有其他acos都是子级。然后授予您的用户父母的权利。如果您已经拥有ACL树结构,面包店的ACL插件可以派上用场。为了构建ACL树结构,在蛋糕手册末尾的教程中的build_acl()脚本很有用。

  2. Allowing to pass the parameter for all users and checking their role in the action is not an option?

    允许为所有用户传递参数并检查他们在操作中的角色是不是一个选项?

#2


0  

the solution for the 2nd problem is here
but this is not implemented using ACL :(

第二个问题的解决方案在这里,但这不是使用ACL实现的:(