createOptionForm not checking policys
Hi! I'm developing a Process management system. Each ticket has a "label" (urgent, need help, etc) If a user has not the role to create a label, the select label with a createOptionForm allows the user to create a label, it does not check the policy of the model.
How can I solve this?
5 Replies
fn() => auth()->user()->can('xx') ? Ticketlabel::createForm() : null
?Shows an empty form
@PabloZagni Did you manage to find a solution to this? I've just realized the huge security hole I introduce due to this :S
Ah just worked out:
My solution for my country field
The button still appears but action is blocked.
@J H u can use
when
for visibility
I'm very happy to contribute! I'll try your code