]> BookStack Code Mirror - bookstack/blobdiff - app/User.php
Added ability to secure images behind auth
[bookstack] / app / User.php
index 3d77cd8ee009cfe0f4a57d27779f3b52fa4b4b75..fd6879ba007dc1d551b7385c6a93c043aebc98db 100644 (file)
@@ -22,7 +22,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
      * The attributes that are mass assignable.
      * @var array
      */
-    protected $fillable = ['name', 'email', 'image_id', 'display']; //to write in user database 
+    protected $fillable = ['name', 'email', 'image_id'];
 
     /**
      * The attributes excluded from the model's JSON form.
@@ -81,7 +81,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
      */
     public function hasSystemRole($role)
     {
-        return $this->roles->pluck('system_name')->contains('admin');
+        return $this->roles->pluck('system_name')->contains($role);
     }
 
     /**