FEATURE: add another permissions
This commit is contained in:
+3
-3
@@ -77,10 +77,10 @@ class User extends Model implements AuthenticableInterface, CanResetPassword
|
||||
*/
|
||||
public function hasAbility($ability)
|
||||
{
|
||||
if (empty(self::$abilities)) {
|
||||
self::$abilities = $this->permissions->pluck('string_id')->toArray();
|
||||
if (!isset(self::$abilities[$this->id])) {
|
||||
self::$abilities[$this->id] = $this->permissions->pluck('string_id')->toArray();
|
||||
}
|
||||
|
||||
return in_array($ability, self::$abilities);
|
||||
return in_array($ability, self::$abilities[$this->id]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user