-
Notifications
You must be signed in to change notification settings - Fork 3
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
152 create a permission group for users #154
Conversation
Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-flower-095494b10-154.centralus.azurestaticapps.net |
@@ -76,10 +76,9 @@ const AppContextProvider: React.FC = ({ | |||
|
|||
const isRuleModifiable = useCallback( | |||
() => | |||
!isRuleSelected() || | |||
(user && creator && user.id === creator.id) || | |||
(user && user.permissions) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that a user is not in the group? And if so can they still edit rules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user is not in the group, user.write_allowed is false.
Users with a cdiscid who are not in the group will be able to view but not edit rules, unless:
- they are in CDISC company,
- CORE_AUTHOR_GROUP is not specified for the env (for training env)
src/types/IUser.ts
Outdated
@@ -2,4 +2,5 @@ export interface IUser { | |||
id: string; | |||
name?: string; | |||
company?: string; | |||
permissions?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is a boolean, should this name be more descriptive like "write_allowed"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-flower-095494b10-154.centralus.azurestaticapps.net |
See the connected Issue for details and acceptance criteria.
To test, you will need to run the static webapp locally.
To simulate the prod env (restricted write access), you will need to add this env var to local.setting.json:
To simulate the training env (all users have write access), do not add the env var.
When you login to the local SWA, it will request User ID and User's claims.
For write permissions, one of the two will need to be true:
If a user does not have write permissions, they should only be able to view/test rules. If they have write permissions, they should be able to do everything else, like modify, save, publish.
I've created a new related issue for securing the API: #153
Note that this issue has always existed and is not newly introduced by this update.