Dan Brown

Fixed and cleaned some permisison/role based components

...@@ -11,7 +11,7 @@ class Permission extends Model ...@@ -11,7 +11,7 @@ class Permission extends Model
11 */ 11 */
12 public function roles() 12 public function roles()
13 { 13 {
14 - return $this->belongsToMany('BookStack\Permissions'); 14 + return $this->belongsToMany('BookStack\Role');
15 } 15 }
16 16
17 /** 17 /**
......
...@@ -44,6 +44,15 @@ class Role extends Model ...@@ -44,6 +44,15 @@ class Role extends Model
44 } 44 }
45 45
46 /** 46 /**
47 + * Detach a single permission from this role.
48 + * @param Permission $permission
49 + */
50 + public function detachPermission(Permission $permission)
51 + {
52 + $this->permissions()->detach($permission->id);
53 + }
54 +
55 + /**
47 * Get the role object for the specified role. 56 * Get the role object for the specified role.
48 * @param $roleName 57 * @param $roleName
49 * @return mixed 58 * @return mixed
......