Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
beshoo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version: 10.14.1
Nova Version: 4.26.3
PHP Version: 8.1
Database Driver & Version: MariaDB
Operating System and Version: Windows 10
Browser type and version: Firefox 115
Description:
Hi Dev,
I would like to describe a problem related to user access control authorization.
We have two user roles: admin and staff.
Admin can see all users, while staff can only see their own record in the '
http://127.0.0.1:8000/dashboard/resources/users' using the following code:But we need to give the user "staff" : viewAnyUser in order to see the User resource '
http://127.0.0.1:8000/dashboard/resources/users' limit to hisuser_id!The problem is that if a
staffuser opens his profile EDIT Mode "http://127.0.0.1:8000/dashboard/resources/users/2/edit" and edits the URL with another user's ID e.g "http://127.0.0.1:8000/dashboard/resources/users/1/edit",Then he can see and update that user's information.
If we deny the
viewAnyUserpermission from the policy, thestaffuser cannot see the User resource at all 'http://127.0.0.1:8000/dashboard/resources/users' I got a 403 error.How can we secure the panel?
Beta Was this translation helpful? Give feedback.
All reactions