X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/3387/head:/app/Auth/Role.php diff --git a/app/Auth/Role.php b/app/Auth/Role.php index 629cd6a95..51b2ce301 100644 --- a/app/Auth/Role.php +++ b/app/Auth/Role.php @@ -1,26 +1,35 @@ -where('display_name', '=', $displayName)->first(); } @@ -86,13 +96,13 @@ class Role extends Model implements Loggable /** * Get the role object for the specified system role. */ - public static function getSystemRole(string $systemName): ?Role + public static function getSystemRole(string $systemName): ?self { return static::query()->where('system_name', '=', $systemName)->first(); } /** - * Get all visible roles + * Get all visible roles. */ public static function visible(): Collection { @@ -104,11 +114,14 @@ class Role extends Model implements Loggable */ public static function restrictable(): Collection { - return static::query()->where('system_name', '!=', 'admin')->get(); + return static::query() + ->where('system_name', '!=', 'admin') + ->orderBy('display_name', 'asc') + ->get(); } /** - * @inheritdoc + * {@inheritdoc} */ public function logDescriptor(): string {