bouncer icon indicating copy to clipboard operation
bouncer copied to clipboard

Owned via in the abilities

Open mruz opened this issue 4 years ago • 0 comments

I need to own one model by 2 or more users, so I put owned_via in the ability option:

        $this->bouncer
            ->allow('buyer')
            ->toOwn(Order::class, ['options' => ['owned_via' => 'buyer_id']])
            ->to(['read', 'write']);

        $this->bouncer
            ->allow('seller')
            ->toOwn(Order::class, ['options' => ['owned_via' => 'seller_id']])
            ->to(['read']);

but it doesn't create a new ability if only the options are different. Could we create separeted record in that case? or maybe we could add owned_via column :thinking:

mruz avatar Aug 07 '20 11:08 mruz