Skip to content
Alex Torscho edited this page Feb 4, 2015 · 5 revisions

User Management

The Backend has a powerful User Management System: you can, besides managing users, manage groups and their permissions.

Groups & Permissions

Permissions are very handy when needed to restrict access to some pages depending on user level.

Groups

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.

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.

Check access permissions

You can check for group or permission access with these two helper functions: in() and can().

Access by group: in()

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.

Access by permission: can()

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.

Model methods: ->in() & ->can()

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();

Clone this wiki locally