Added hidden public role to fit with new permissions system

This commit is contained in:
Dan Brown
2016-05-01 19:36:53 +01:00
parent 59367b3417
commit 05666efda9
14 changed files with 166 additions and 26 deletions

View File

@ -168,6 +168,15 @@ class UserRepo
];
}
/**
* Get the roles in the system that are assignable to a user.
* @return mixed
*/
public function getAssignableRoles()
{
return $this->role->visible();
}
/**
* Get all the roles which can be given restricted access to
* other entities in the system.
@ -175,7 +184,7 @@ class UserRepo
*/
public function getRestrictableRoles()
{
return $this->role->where('name', '!=', 'admin')->get();
return $this->role->where('hidden', '=', false)->where('system_name', '=', '')->get();
}
}