Policy not enforced

Hi, I created a "LocationPolicy" that looks like this:
    public function view(User $user, Location $location)
    {
        $allowedLocations = $user->locations;
        return $allowedLocations->contains($location);
    }


and registered it like so:
    protected $policies = [
        User::class => LocationPolicy::class
    ];

    public function boot(): void
    {
        $this->registerPolicies();
    }


But this policy doesn't seem to be enforced when using a select multiple:
                    Forms\Components\Select::make('locations')
                                           ->label(trans('locations.plural'))
                                           ->multiple()
                                           ->searchable()
                                           ->relationship('locations', 'name')
                                           ->preload()
                                           ->required(),


Currently the user can still choose all locations, where it should only be those relateded with the user model.

What am I missing here?
Thank you!
Was this page helpful?