1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Refactored permission system components

Split joint permission creation into chunks

Fixes #374
This commit is contained in:
Dan Brown
2017-04-29 22:01:43 +01:00
parent ad4642c2c4
commit 1859a4d356
8 changed files with 147 additions and 126 deletions

View File

@ -94,17 +94,6 @@ class Entity extends Ownable
->where('action', '=', $action)->count() > 0;
}
/**
* Check if this entity has live (active) restrictions in place.
* @param $role_id
* @param $action
* @return bool
*/
public function hasActiveRestriction($role_id, $action)
{
return $this->getRawAttribute('restricted') && $this->hasRestriction($role_id, $action);
}
/**
* Get the entity jointPermissions this is connected to.
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
@ -176,5 +165,11 @@ class Entity extends Ownable
*/
public function entityRawQuery(){return '';}
/**
* Get the url of this entity
* @param $path
* @return string
*/
public function getUrl($path){return '/';}
}