Feature : Secure Public Access #43
dennyabrain
started this conversation in
Ideas
Replies: 1 comment
-
On the frontend, you protect UI components against unauthorized roles by using a role aware component like this <Admin>only admin can see this</Admin>
<Author>only author can see this</Author>
<Reader>only readers can see this</Reader>
<AdminOrAuthor>only admin or author can see this</AdminOrAuthor> These components use the UserContext to get the user's role, so that needs to be set somewhere in the parent. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a working prototype of the authorization middleware.
Some code to illustrate how its used :
I've modelled the middleware as a Guard in the real world. It can accept instructions. Two type of instructions as of now are allow and block. Each instruction has a role and a condition. This condition can be true or false or a function that returns true or false.
Explanation of middleware usage code above :
viewer
admin
author
, if they satisfy the condition specified in the functionisCreatorOfDataset
Beta Was this translation helpful? Give feedback.
All reactions