]> BookStack Code Mirror - bookstack/blobdiff - app/Auth/Role.php
Modernize third party services' logos
[bookstack] / app / Auth / Role.php
index 629cd6a955d8abf7961b67aa1c598d1d62d30658..46921caeb1a2adebb9255088c39dd1c13489497b 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace BookStack\Auth;
+<?php
+
+namespace BookStack\Auth;
 
 use BookStack\Auth\Permissions\JointPermission;
 use BookStack\Auth\Permissions\RolePermission;
@@ -9,16 +11,18 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
 use Illuminate\Database\Eloquent\Relations\HasMany;
 
 /**
- * Class Role
- * @property int $id
- * @property string $display_name
- * @property string $description
- * @property string $external_auth_id
- * @property string $system_name
+ * Class Role.
+ *
+ * @property int        $id
+ * @property string     $display_name
+ * @property string     $description
+ * @property string     $external_auth_id
+ * @property string     $system_name
+ * @property bool       $mfa_enforced
+ * @property Collection $users
  */
 class Role extends Model implements Loggable
 {
-
     protected $fillable = ['display_name', 'description', 'external_auth_id'];
 
     /**
@@ -56,6 +60,7 @@ class Role extends Model implements Loggable
                 return true;
             }
         }
+
         return false;
     }
 
@@ -92,7 +97,7 @@ class Role extends Model implements Loggable
     }
 
     /**
-     * Get all visible roles
+     * Get all visible roles.
      */
     public static function visible(): Collection
     {
@@ -104,7 +109,10 @@ 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();
     }
 
     /**