Dan Brown

Fixed and cleaned some permisison/role based components

......@@ -11,7 +11,7 @@ class Permission extends Model
*/
public function roles()
{
return $this->belongsToMany('BookStack\Permissions');
return $this->belongsToMany('BookStack\Role');
}
/**
......
......@@ -44,6 +44,15 @@ class Role extends Model
}
/**
* 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.
* @param $roleName
* @return mixed
......