How to set admin role to have access in viewing and deleting log? #91
Answered
by
arukompas
anonymouse703
asked this question in
Q&A
-
Base on the code you can set it by email for the user to view the log but how about by role (admin role)?
and also on the download and delete? download
and delete
|
Beta Was this translation helpful? Give feedback.
Answered by
arukompas
Sep 9, 2022
Replies: 1 comment 4 replies
-
Within the callback you can execute any code you want. The above is just an example. So use however you normally use roles. For example, if your roles package or implementation has LogViewer::auth(fn ($request) => $request->user()->hasRole('admin')); From the callback you just need to return |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
anonymouse703
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Within the callback you can execute any code you want. The above is just an example.
So use however you normally use roles.
For example, if your roles package or implementation has
hasRole('admin')
method, then you would simply use that in the callback:From the callback you just need to return
true
to allow access, andfalse
to forbid access.