Until now, we saw how a view that is accessible to a certain set of admin users can be created easily using the
is_accessible() method. This can be extended to have different kinds of scenarios where specific users will be able to view specific views. There is another way of implementing user roles at a much more granular level in a model where the roles determine whether a user can perform all, some, or any of the CRUD operations.
In this recipe, we will see a basic way of creating user roles, where an admin user can only perform actions they are entitled to.
Remember that this is just one way of implementing user roles. There are many better ways of doing this, but this one seems to be the best one to demonstrate ...