. */ namespace App\Policies; use App\Models\User; class UserPolicy { public function createAlbum(User $userToAuthorize, User $user) { return $userToAuthorize->id === $user->id || $userToAuthorize->hasRole('admin'); } public function createTrack(User $userToAuthorize, User $user) { return $userToAuthorize->id === $user->id || $userToAuthorize->hasRole('admin'); } public function getAlbums(User $userToAuthorize, User $user) { return $userToAuthorize->id === $user->id || $userToAuthorize->hasRole('admin'); } public function getImages(User $userToAuthorize, User $user) { return $userToAuthorize->id === $user->id || $userToAuthorize->hasRole('admin'); } public function edit(User $userToAuthorize, User $user) { return $userToAuthorize->id === $user->id || $userToAuthorize->hasRole('admin'); } }