The more roles an application has, the more complex its Access Control Layer becomes. Luckily, one of the authentication schemes provided by the
Auth component allows us to easily define which actions are accessible by certain roles (known as groups), using command-line tools. In this recipe, you will learn how to set up ACL on your application.
We should have a table to hold the roles, named
If you do not have one already, create it using the following statement:
CREATE TABLE `groups`( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, PRIMARY KEY(`id`) );
If you do not have any records in your
groups table, create some by running the following SQL statement: ...