// show a form to edit stuff.
Check if the user has a role
// Show a form to edit stuff, if the 'Moderator' role has the 'edit' permission.
Check if the user is an admin
To use this function, make sure to give a user the 'Admin' role.
You could for example use this to create a filter that protects your backend.
if ( ! Auth::isAdmin()) returnRedirect::to('login');
Getting all of the available roles/permissions/users
//Example of both optional parameterAuth::allUsers('json', true);
Both accept two optional parameters, which is the format of the returned results: array, object or json. By default an array is returned. The second is a boolean, set this to true if you want to include trashed items.
A second parameter is accepted on all three functions. This boolean states if the entry (role/perm/user) should be deleted with force (default set to false). Soft-deleted (so not with force) will be left out of every request to the database (unless otherwise stated). They can however be restored.