Suggestion for Groups
maig81 opened this issue · 2 comments
maig81 commented
#Can I suggest a method for testing if the user is an a group (or something similar):
public function has_group($group){ return ($this->getRoles()->where('group', 'LIKE', $group)->first() ? true : false); }
I am using it in my User model, but i think it should be a part of Roles.
httpoz commented
I have added this in ba8a0be . So you would do:
$user->inGroup('system.managers');
I will however have it working in a v2.1 release as soon as possible.
maig81 commented
Even better name :) Thanks!