mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-26 18:30:50 +08:00
Fixed and cleaned some permisison/role based components
This commit is contained in:
parent
66ba773367
commit
1a7de4c2d6
|
@ -11,7 +11,7 @@ class Permission extends Model
|
||||||
*/
|
*/
|
||||||
public function roles()
|
public function roles()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('BookStack\Permissions');
|
return $this->belongsToMany('BookStack\Role');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -43,6 +43,15 @@ class Role extends Model
|
||||||
$this->permissions()->attach($permission->id);
|
$this->permissions()->attach($permission->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detach a single permission from this role.
|
||||||
|
* @param Permission $permission
|
||||||
|
*/
|
||||||
|
public function detachPermission(Permission $permission)
|
||||||
|
{
|
||||||
|
$this->permissions()->detach($permission->id);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the role object for the specified role.
|
* Get the role object for the specified role.
|
||||||
* @param $roleName
|
* @param $roleName
|
||||||
|
|
Loading…
Reference in New Issue
Block a user