Check if a role owns a model
obrunsmann opened this issue · comments
Oliver Brunsmann commented
To implement a settings UI it is necessary to find out if a role can own or manage a model. So I'd suggest a method like
$role->canOwn(Task::class);
$role->canManage(Task::class);
Joseph Silber commented
The way to handle it in the UI would be to have a list of actual Ability
instances. For example:
$available = Bouncer::ability()->pluck('title', 'id');
$granted = $role->getAbilities();
And then have the user toggle those directly.