-
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
Design fine-grained access control within record manager #70
Conversation
49748c2
to
068949e
Compare
Sorry, we did not understand each other. To me the ontology is one of most important artefact of SW and thus i want to keep ontology conventions i.e. "-" instead of "_" -- which was broken by your last commit. |
@blcham I noticed that some properties don't follow the convention. Should I update them as well in the current ticket? Such as: public final static String s_p_has_object_value = "http://onto.fel.cvut.cz/ontologies/documentation/has_object_value";
public final static String s_p_has_related_question = "http://onto.fel.cvut.cz/ontologies/documentation/has_related_question"; |
bb9f1d8
to
068949e
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, we should discuss it on call ASAP
5c84bf4
to
fc33cc1
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.
Lot of work need to be done, please fix those that u understand ASAP
public static final String ROLE_ADMIN = "ROLE_ADMIN"; | ||
public static final String ROLE_COMPLETE_RECORDS = "rm_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.
Why do we need those constants? Why Role enum is not enough for this case? (same way as we discussed in frontend)
@@ -7,8 +7,19 @@ | |||
import java.util.stream.Stream; | |||
|
|||
public enum Role { | |||
USER(SecurityConstants.ROLE_USER, Vocabulary.s_c_doctor), | |||
ADMIN(SecurityConstants.ROLE_ADMIN, Vocabulary.s_c_administrator); | |||
USER(SecurityConstants.ROLE_USER, Vocabulary.s_i_user), |
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.
Why we are duplicating again study/model/Role.java
? Why cant we reuse it ?
@@ -143,6 +142,7 @@ public static User generateUser(Institution institution){ | |||
person.setLastName("RandomLastName" + randomInt()); | |||
person.setEmailAddress("RandomEmail" + randomInt() + "@random.rand"); | |||
person.setInstitution(institution); | |||
person.setRoleGroup(Vocabulary.s_i_operator_admin_role_group); |
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.
Why ?
|
||
assertEquals(2, numberOfInvestigators); | ||
} | ||
// @Test |
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.
Why commenting out?
@@ -49,10 +49,10 @@ void attemptSwitchUserSwitchesCurrentUserToTarget() { | |||
@Test | |||
void attemptSwitchUserThrowsBadRequestExceptionWhenTargetUserIsAdmin() { | |||
final User source = Generator.generateUser(null); | |||
source.addType(Vocabulary.s_c_administrator); | |||
source.addType(Vocabulary.s_i_administrator); |
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.
We are mixing two approaches here how to associate user with role group/roles
@@ -66,6 +68,7 @@ public void setUp() { | |||
Institution institution = Generator.generateInstitution(); | |||
institution.setKey(IdentificationUtils.generateKey()); | |||
this.user = Generator.getUser(USERNAME, PASSWORD, "John", "Johnie", "[email protected]", institution); | |||
this.user.setRoleGroup(RoleGroup.OPERATOR_ADMIN.getType()); |
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.
?
fc33cc1
to
158ac5e
Compare
src/main/resources/model.ttl
Outdated
### http://onto.fel.cvut.cz/ontologies/record-manager/has-role-group | ||
rm:has-role-group rdf:type owl:ObjectProperty ; | ||
rdfs:subPropertyOf rm:relates-to; | ||
rdfs:label "has role group"@en. | ||
|
||
### http://onto.fel.cvut.cz/ontologies/record-manager/has-role | ||
rm:has-role rdf:type owl:ObjectProperty ; | ||
rdfs:subPropertyOf rm:relates-to; | ||
rdfs:label "has role"@en. | ||
|
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 also domain and range props.
158ac5e
to
cd76add
Compare
cd76add
to
3797055
Compare
old branch closed in favor of #71 |
Resolves partially kbss-cvut/record-manager-ui#202
Resolves partially kbss-cvut/record-manager-ui#158