-
Notifications
You must be signed in to change notification settings - Fork 132
C. User Groups & Permission
darryl fernandez edited this page Oct 12, 2017
·
1 revision
$User = \Auth::user();
$group = 1; // using group ID
$group = 'members'; // or using group name
$group = $GroupObject; // or the group object
$User->inGroup($group); // returns true or false
$permission = 'blog.create';
$UserObject->hasPermission($permission); // returns true or false
// or a set of any of this permissions
$permissions = array('blog.create','blog.delete');
$UserObject->hasAnyPermission($permissions);
// returns true or false
$UserObject->isSuperUser();
Get User's combined permissions. This will include permission acquired from its group and its specific given permissions:
$UserObject->getCombinedPermissions(); // returns array of permissions