JosephSilber / bouncer

Laravel Eloquent roles and abilities.
MIT License
3.43k stars 330 forks source link

How can I get abilities assigned to a role and abilities directly assigned to a user (not via roles) #617

Closed undjike closed 1 year ago

undjike commented 1 year ago

Can anyone help please ?

JosephSilber commented 1 year ago

https://github.com/JosephSilber/bouncer#giving-a-user-an-ability-directly

undjike commented 1 year ago

Sorry, my problem is not how to assign abilities directly to a user. My point is how to retrieve the list of abilities directly assigned to him (not via roles).

JosephSilber commented 1 year ago

The regular abilities Eloquent relation contains that:

$user->abilities
undjike commented 1 year ago

OK and role abilities will be...

$role->abilities

Thanks.