-
Notifications
You must be signed in to change notification settings - Fork 0
User Management
The Backend has a powerful User Management System: you can, besides managing users, manage groups and their permissions.
Permissions are very handy when needed to restrict access to some pages depending on user level.
Each group has a set of permissions which you can manage in the Backend (link: admin/users/groups). Then you can assign these groups to users to give them permissions.
Permission cannot be managed. You cannot add, edit or delete them in the Backend. They only appear with each new feature which means they are added with each new Seeder. This will help to avoid needless problems and issues.
You can check for group or permission access with these two helper functions: in() and can().
The function accepts one parameter: group handle or group ID.
var_dump(in('members')); ==> true, if the authenticated user is in "Members" group, false otherwise.
The function accepts one parameter: permission handle or permission ID.
var_dump(can('createUsers')); ==> true, if the authenticated user can perform 'createUsers' action, false otherwise.
You can also check for access permissions for a specific user:
$user = User::find(1);
if (!$user->can('deleteUsers') && !$user->in('admins'))
return Redirect::back();