mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-04 08:54:33 +08:00
Added options to allow whole site to be made public. Fixes #3.
This commit is contained in:
@ -68,6 +68,9 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
*/
|
||||
public function can($permissionName)
|
||||
{
|
||||
if($this->email == 'guest') {
|
||||
return false;
|
||||
}
|
||||
$permissions = $this->role->permissions()->get();
|
||||
$permissionSearch = $permissions->search(function ($item, $key) use ($permissionName) {
|
||||
return $item->name == $permissionName;
|
||||
|
Reference in New Issue
Block a user