Added gate to auth service provider

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-06-24 14:02:40 +01:00
parent 52c4885335
commit 2b43f3cb84

View file

@ -232,5 +232,12 @@ class AuthServiceProvider extends ServiceProvider
|| $user->can('update', User::class)
|| $user->can('create', User::class);
});
// This determines whether the user can edit their profile based on the setting in Admin > General
Gate::define('self.profile', function ($user) {
return $user->canEditProfile();
});
}
}