-
Notifications
You must be signed in to change notification settings - Fork 2
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
fine grained access #208
base: main
Are you sure you want to change the base?
fine grained access #208
Conversation
7b2e15d
to
c94b109
Compare
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.
see my comments + tests are failing
src/components/user/User.jsx
Outdated
@@ -4,15 +4,16 @@ import withI18n from "../../i18n/withI18n"; | |||
import { injectIntl } from "react-intl"; | |||
import HorizontalInput from "../HorizontalInput"; | |||
import UserValidator from "../../validation/UserValidator"; | |||
import { ACTION_STATUS, ROLE } from "../../constants/DefaultConstants"; | |||
import { ACTION_STATUS, ROLE, ROLE_TYPE } from "../../constants/DefaultConstants"; |
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.
what is role_type?
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.
it is a mapper between roles and types
src/constants/DefaultConstants.js
Outdated
}; | ||
|
||
export const TYPE_ROLE = { |
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.
Do we really need to duplicate strings from ROLE?
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.
can we use convention instead? see below
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.
There may be an issue because some roles, such as admin and doctor, do not have the 'rm' prefix, making it difficult to differentiate them. Also there is a problem if we want to display roles in readable form such as "Publish Records" etc.
export const DELETE_ALL_RECORDS_TYPE = "http://onto.fel.cvut.cz/ontologies/record-manager/delete-all-records"; | ||
export const EDIT_ALL_RECORDS_TYPE = "http://onto.fel.cvut.cz/ontologies/record-manager/edit-all-records"; | ||
export const VIEW_ALL_RECORDS_TYPE = "http://onto.fel.cvut.cz/ontologies/record-manager/view-all-records"; | ||
export const DELETE_ORGANIZATION_RECORDS_TYPE = |
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.
I suggest to infer local name from url by convention:
rm_ <--- 'http://onto.fel.cvut.cz/ontologies/record-manager/'
view_all_records <--- view-all-records
convention is that _ is used instead -
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.
I initially chose the (-) as the divider because I noticed in mode.ttl that other resources and properties use it, such as:
### http://onto.fel.cvut.cz/ontologies/record-manager/has-last-editor
rm:has-last-editor rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf rm:relates-to .
### http://onto.fel.cvut.cz/ontologies/record-manager/has-member
rm:has-member rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf rm:relates-to ;
owl:inverseOf rm:is-member-of .
### http://onto.fel.cvut.cz/ontologies/record-manager/has-owner
rm:has-owner rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf rm:relates-to .
However, I will change it to _
.
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.
done
src/constants/Vocabulary.js
Outdated
@@ -8,3 +8,17 @@ export const RDFS_COMMENT = "http://www.w3.org/2000/01/rdf-schema#comment"; | |||
export const ADMIN_TYPE = "http://onto.fel.cvut.cz/ontologies/record-manager/administrator"; | |||
export const DOCTOR_TYPE = "http://onto.fel.cvut.cz/ontologies/record-manager/doctor"; | |||
export const IMPERSONATOR_TYPE = "http://onto.fel.cvut.cz/ontologies/record-manager/impersonator"; | |||
export const COMPLETE_RECORDS_TYPE = "http://onto.fel.cvut.cz/ontologies/record-manager/record-complete"; |
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.
inconsistent with reject_records ---> complete-records
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.
done
ecd0d6d
to
4be2f47
Compare
@blcham The admin can choose the roles for users if he have role EDIT_USER. The group input currently does not function because we need to discuss how it should be implemented. It might be better to disable the Roles input and assign roles based on the chosen group. The next point for discussion is how Keycloak will retrieve information about roles. Currently, Keycloak only gets information about roles for the current user, which makes it impossible to display accurate information about other users. I think it would be beneficial to configure the Keycloak plugin to also save this information. |
4be2f47
to
62d2b09
Compare
we do not want to assign roles, but role groups !! --- as we discussed we want to keep label "role" in RM-UI but assign there ONE role group ... but as i said if it is not changeable or even not visible there i fo not care that much -- it is not that important, we have keycloak for that. |
@blcham In Keycloak authorization, I recommend not displaying the group role, as doing so would require storing it in a triple (via the plugin change). So we will have these group roles if undestand correctly: [OPERATOR_ADMIN]
[OPERATOR_USER]
[SUPPLIER_ADMIN]
[SUPPIER]
[NON-ANONYMOUS QUESTIONARE]
|
src/constants/DefaultConstants.js
Outdated
@@ -81,8 +82,45 @@ export const ACTION_STATUS = { | |||
|
|||
export const ROLE = { | |||
ADMIN: "Admin", | |||
DOCTOR: "Regular User", | |||
DOCTOR: "Doctor", |
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.
add comment that this is deprecated and will be replaced
7e5bb61
to
a8624e2
Compare
6b23dc1
to
5050dec
Compare
0a9b093
to
26f1cdc
Compare
@palagdan I rebased this PR |
26f1cdc
to
3e4992c
Compare
4351437
to
9b15576
Compare
@palagdan could you describe what the issue is and in which profile (I've lost it somehow :( |
9b15576
to
ff5b232
Compare
Resolves partially #202
Resolves partially #158