←CakePHP ACL Tutorial: How To Check Access| CakePHP ACL Tutorial: Initial Setup→
View full index of ACL Tutorial Articles
The following example should provide a quick overview of how the ACL Component is used to restrict site access, if it is used in conjunction with the built-in Authentication Component.
http://www.cakephp.org/recipes/edit
When the request is made, the Authentication Component determines that the requested URL corresponds to the controller named Recipes and the action named edit which corresponds to the action type of update.
The Authentication Component determines that access to this combination of controller and action is restricted, so checks to see if the user has been logged in.
Since the user has not been logged in, the Authentication Component redirects the user to a login form which requests a username and password.
After submitting the form with a username and password that match an entry in the user database, the Authentication Component determines that the user’s name is bettycrocker.
The Authentication Component asks the ACL Component if the user named bettycrocker is allowed to update models governed by the Recipes controller.
The ACL Component then examines it’s data tables and discovers that the user bettycrocker has no explicitly set permissions for any pages of the site. It determines, however, that she is a member of the chefs group, and that any user in the group chefs has the ability to update Recipes, so the ACL Component responds that,
since bettycrocker is a chef, she has the inherited permission to update recipes.
Upon learning about this right of access, the Authentication Component directs the user to the requested page. Had permission not been granted, any one of a number of alternate pages would be displayed depending on how the Authentication Component
Key Point: ACL Must Be Used With A User Login System
What the example should make clear is that in this type of usage, the ACL Component’s job is to check to see if a submitted user
has particular permissions, inherited or explicitly set, for a submitted page.
Therefore, the ACL Component must be used in conjunction with a component that does the following:
The built-in Authentication Component is a natural choice to use for the needed user login system.
Next Tutorial: Usage With Auth Component
Monday April 14, 2008
←CakePHP ACL Tutorial: How To Check Access| CakePHP ACL Tutorial: Initial Setup→
I'm Aran Johnson and I make websites.
I primarily use: PHP, MySQL, SubVersion, CakePHP, TextPattern, Cream Text Editor, and Addi Turbo Needles
GlaxoSmithKline Give Canadians The Facts; Keeps Americans In the Dark
Why Joyent Is So Much Better Than Hostway