You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
It's normal that every role is authorized to CRUD different data source. When giving the different rules, Canner component should generate the different UIs and have different behaviors such as disabled actions, hidden field, and disallow the specific pages (e.g. /posts/postID1).
Solution
Canner will get an object rules which records the authorization of the current user. The helper function rbac will check with the rules and keyName and return the corresponding properties of each component.
disabled property: Handled by component, each component should have it disabled UI, for example, a table component should hide the edit button and delete button.
hidden property: Handled In higher order component, if there is a hidden property, the component WON'T be rendered.
Rules Example
{
posts: ['create', 'update', 'delete', 'read']
}
cc @wwwy3y3, @FrankYang0529, please take a look, does the format of rules match your backend plan or you prefer different format?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Why
It's normal that every role is authorized to CRUD different data source. When giving the different
rules
, Canner component should generate the different UIs and have different behaviors such as disabled actions, hidden field, and disallow the specific pages (e.g./posts/postID1
).Solution
Canner will get an object
rules
which records the authorization of the current user. The helper functionrbac
will check with therules
andkeyName
and return the corresponding properties of each component.Rules Example
cc @wwwy3y3, @FrankYang0529, please take a look, does the format of rules match your backend plan or you prefer different format?
The text was updated successfully, but these errors were encountered: