开发者

CakePHP : Explain ACL

开发者 https://www.devze.com 2023-02-09 13:01 出处:网络
I have been looking at CakePHP\'s ACL tutorials over the last week and it all seems massively complicated. For instance say I had a website that was a simple blog and had the following user types: Adm

I have been looking at CakePHP's ACL tutorials over the last week and it all seems massively complicated. For instance say I had a website that was a simple blog and had the following user types: Admin, Member and Guest. Why could I not have a users table and a groups table (the groups table having a simple CRUD set of columns with 0 or 1 values for each group type) and then link the users to the groups with a simple ID. And then in the controller just check if the user is logged in or if they are in which group to allow access.

I'm confused about why ACL requires all that additional code and tables, more so why does the ACL tab开发者_如何学编程le need rebuilding when ever a new controller is created?

If someone could explain some of these questions, it'd be much appreciated. Thanks.


2-part tutorial on CakePHP ACL

http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1

http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-2

It has a much better explanation.


It sounds like what you may want to check out a plugin called Permissionable since it has the concepts of groups. It has a bit of a learning curve to grasp the concepts behind it but if you're familiar with UNIX permissions, that will help.

Here is a good explanation on it.

0

精彩评论

暂无评论...
验证码 换一张
取 消