createOption visivility according to permissions.
Is there a way to hide createOption button when a user does not have permission to model.create?
6 Replies
If they don’t have permission to create then they shouldn’t even be able to access the page.
No... I mean The createOption from select field....
Ah. What have you tried? It might just work out of the box with a policy for that model.
I didnt... I Just saw that for example of State that hasMany cities... On The City's form, and in The States select field, if user does not have peemittion for States.create it still shows createOption button. I thoght that it shloud not happen...
And im a newbie yet... I Code lika a Hobbie, you know... Like learning and consuming php and laravel skills...
I’d start with making a policy for the model that is used in the relationship for the select field.
Yep... Thank you!