Skip to content

Commit

Permalink
Role is protected
Browse files Browse the repository at this point in the history
  • Loading branch information
NatachaH committed Feb 23, 2021
1 parent c257d81 commit 22bb08f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@ class Role extends Model
'guard','name'
];

/**
* Check if the role is protected
* @return boolean
*/
public function getIsProtectedAttribute()
{
return in_array($this->guard, config('access-control.protected'));
}

}

0 comments on commit 22bb08f

Please sign in to comment.