]>
BookStack Code Mirror - bookstack/commitdiff
projects
/
bookstack
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
66ba773
)
Fixed and cleaned some permisison/role based components
author
Dan Brown
<redacted>
Sat, 9 Apr 2016 11:37:58 +0000
(12:37 +0100)
committer
Dan Brown
<redacted>
Sat, 9 Apr 2016 11:37:58 +0000
(12:37 +0100)
app/Permission.php
patch
|
blob
|
history
app/Role.php
patch
|
blob
|
history
diff --git
a/app/Permission.php
b/app/Permission.php
index 794df01ab8338e624f3f3b03c6521d6b7e3217ae..a146dcf63c3dff52384caaf705f8ff25163e6f8f 100644
(file)
--- a/
app/Permission.php
+++ b/
app/Permission.php
@@
-11,7
+11,7
@@
class Permission extends Model
*/
public function roles()
{
- return $this->belongsToMany('BookStack\
Permissions
');
+ return $this->belongsToMany('BookStack\
Role
');
}
/**
diff --git
a/app/Role.php
b/app/Role.php
index 270e4e0b8e32ce1287be95dae0d1c138d8120e3b..4e14db181e62fe3f4a9a7a9fe665e7572b61d4b4 100644
(file)
--- a/
app/Role.php
+++ b/
app/Role.php
@@
-43,6
+43,15
@@
class Role extends Model
$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.
* @param $roleName