New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide search and create buttons on panel #252
Comments
You can create a policy to hide resource actions https://nova.laravel.com/docs/1.0/resources/authorization.html#policies |
Thanks, this a good way of doing it. Preferably, I'd like to disable them for all users of any level but this may have to do. |
All users would be a Policy defined as
|
For search, you can add the following to your Resource:
Or give $search an empty array |
Add this to resource:
|
What if i want to hide the button only on the index page and not on the view page? I tried with the |
Did you find any solution for this scenario? |
Nope :/ |
This isn't a real solution. But..... because there doesn't seem to be a view dependant permissions way of governing the create button, ie. a permission that says for the create permission when viewing this parent class return no, all others yes. I think if you were to handle it with permissions that would be the way to do it. Alternatively and IMO this should already be a thing,
Credit for the concept here: https://vander.host/knowledgebase/software-development/using-css-selectors-to-hide-button-in-laravel-nova/ Obviously, this is by-passable security-wise, however, I don't want to outright block the creation of new line items in the HasMany child class that references this class... I just want to block attempting to create them from this class because there's a dual belongs to relationship on the child class and the other class is authoritative, and can, depending on the users access level, dictate what entries can and can't be selected from the second belongsto class. |
The |
Is it possible to hide these tools for a relation within a resource?
The text was updated successfully, but these errors were encountered: