]> BookStack Code Mirror - bookstack/blobdiff - app/Repos/UserRepo.php
Added hidden public role to fit with new permissions system
[bookstack] / app / Repos / UserRepo.php
index 9b5c8d7e7f20c13816ac421664b54192cb7b187a..b4931bdffbd859222238bcefbfa56c0fd3cbb2cb 100644 (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();
     }
 
 }
\ No newline at end of file