Skip to content
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

What to do if user should assign permissions but shouldn't edit permissions? #87

Closed
yehudahkay opened this issue Jul 24, 2019 · 4 comments

Comments

@yehudahkay
Copy link

yehudahkay commented Jul 24, 2019

Hi and thank you for the package!

I would like certain users to assign permissions to users but not edit or create the actual permissions. If I don't include the tool on novaserviceprovider.php than I get a 404 error when clicking to view a user.

@francoisauclair911
Copy link

You should use your own Policies and restrict the edit/update

#42

Also concerning the create permissions you could use the viewAny method on your permission policy and also hide the create role button via the create method on your Permission policy

@yehudahkay
Copy link
Author

yehudahkay commented Sep 9, 2019

But how would i hide it from the sidebar? There are users which don't need to see the permissions and roles on the sidebar, as they can't create or edit

@abr4xas
Copy link

abr4xas commented Sep 14, 2019

Hey @yehudahkay I think that you need to do something like this:

(new NovaPermissionTool)->canSee(function ($request) {
  if (auth()->user()->hasRole('admin')) {
      return true;
  }
}),

@yehudahkay
Copy link
Author

The problem is that is there non admin user who should be able to give a user permissions, he won't be able to with that code. If on the other hand he can give permissions, he can also view the permissions menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants