]> git.localhorst.tv Git - alttp.git/blobdiff - app/Policies/UserPolicy.php
user nicknames
[alttp.git] / app / Policies / UserPolicy.php
index 67bc561b8c2b2d922f6b40944e43863d2a88b6ce..b11e3a812ff8c52596b2756e9fab007584c8bdd9 100644 (file)
@@ -91,6 +91,18 @@ class UserPolicy
                return false;
        }
 
+       /**
+        * Determine whether the user change the stream link of the model.
+        *
+        * @param  \App\Models\User  $user
+        * @param  \App\Models\User  $model
+        * @return \Illuminate\Auth\Access\Response|bool
+        */
+       public function setNickname(User $user, User $model)
+       {
+               return $user->role == 'admin' || $user->id == $model->id;
+       }
+
        /**
         * Determine whether the user change the stream link of the model.
         *