X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FPolicies%2FUserPolicy.php;h=b11e3a812ff8c52596b2756e9fab007584c8bdd9;hb=82b95e7542824bcdf4f1b245559cb1c93f4eafdd;hp=67bc561b8c2b2d922f6b40944e43863d2a88b6ce;hpb=ce0c2752445b1d0960e331a335f56001f3c521c6;p=alttp.git diff --git a/app/Policies/UserPolicy.php b/app/Policies/UserPolicy.php index 67bc561..b11e3a8 100644 --- a/app/Policies/UserPolicy.php +++ b/app/Policies/UserPolicy.php @@ -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. *