Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
palagdan committed Sep 3, 2024
1 parent 3111977 commit 068949e
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/main/java/cz/cvut/kbss/study/security/SecurityConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ private SecurityConstants() {
public static final int SESSION_TIMEOUT = 12 * 60 * 60;

public static final String ROLE_USER = "ROLE_USER";

public static final String ROLE_ADMIN = "ROLE_ADMIN";

public static final String ROLE_COMPLETE_RECORDS = "rm_complete_records";
public static final String ROLE_DELETE_ALL_RECORDS = "rm_delete_all_records";
public static final String ROLE_DELETE_ORGANIZATION_RECORDS = "rm_delete_organization_records";
public static final String ROLE_EDIT_ALL_RECORDS = "rm_edit_all_records";
public static final String ROLE_EDIT_ORGANIZATION_RECORDS = "rm_edit_organization_records";
public static final String ROLE_EDIT_USERS = "rm_edit_users";
public static final String ROLE_IMPORT_CODELISTS = "rm_import_codelists";
public static final String ROLE_PUBLISH_RECORDS = "rm_publish_records";
public static final String ROLE_REJECT_RECORDS = "rm_reject_records";
public static final String ROLE_VIEW_ALL_RECORDS = "rm_view_all_records";
public static final String ROLE_VIEW_ORGANIZATION_RECORDS = "rm_view_organization_records";


}
13 changes: 12 additions & 1 deletion src/main/java/cz/cvut/kbss/study/security/model/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@

public enum Role {
USER(SecurityConstants.ROLE_USER, Vocabulary.s_c_doctor),
ADMIN(SecurityConstants.ROLE_ADMIN, Vocabulary.s_c_administrator);
ADMIN(SecurityConstants.ROLE_ADMIN, Vocabulary.s_c_administrator),
COMPLETE_RECORDS(SecurityConstants.ROLE_COMPLETE_RECORDS, Vocabulary.s_c_complete_records),
DELETE_ALL_RECORDS(SecurityConstants.ROLE_DELETE_ALL_RECORDS, Vocabulary.s_c_delete_all_records),
DELETE_ORGANIZATIONS_RECORDS(SecurityConstants.ROLE_DELETE_ORGANIZATION_RECORDS, Vocabulary.s_c_delete_organization_records),
EDIT_ALL_RECORDS(SecurityConstants.ROLE_EDIT_ALL_RECORDS, Vocabulary.s_c_edit_all_records),
EDIT_ORGANIZATIONS_RECORDS(SecurityConstants.ROLE_EDIT_ORGANIZATION_RECORDS, Vocabulary.s_c_edit_organization_records),
EDIT_USERS(SecurityConstants.ROLE_EDIT_USERS, Vocabulary.s_c_edit_users),
IMPORT_CODELISTS(SecurityConstants.ROLE_IMPORT_CODELISTS, Vocabulary.s_c_import_codelists),
PUBLISH_RECORDS(SecurityConstants.ROLE_PUBLISH_RECORDS, Vocabulary.s_c_publish_records),
REJECT_RECORDS(SecurityConstants.ROLE_REJECT_RECORDS, Vocabulary.s_c_reject_records),
VIEW_ALL_RECORDS(SecurityConstants.ROLE_VIEW_ALL_RECORDS, Vocabulary.s_c_view_all_records),
VIEW_ORGANIZATIONS_RECORDS(SecurityConstants.ROLE_VIEW_ORGANIZATION_RECORDS, Vocabulary.s_c_view_organization_records);

private final String name;
private final String type;
Expand Down
51 changes: 51 additions & 0 deletions src/main/resources/model.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,54 @@ rm:rejected-record-phase rdf:type owl:Class ;
rdfs:label "rejected record phase"@en .

### Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi

#################################################################
# New Roles
#################################################################


### http://onto.fel.cvut.cz/ontologies/record-manager/complete-records
rm:complete-records rdf:type owl:Class ;
rdfs:label "Complete Records"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/delete-all-records
rm:delete-all-records rdf:type owl:Class ;
rdfs:label "Delete All Records"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/edit-all-records
rm:edit-all-records rdf:type owl:Class ;
rdfs:label "Edit All Records"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/view-all-records
rm:view-all-records rdf:type owl:Class ;
rdfs:label "View All Records"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/delete-organization-records
rm:delete-organization-records rdf:type owl:Class ;
rdfs:label "Delete Organization Records"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/edit-organization-records
rm:edit-organization-records rdf:type owl:Class ;
rdfs:label "Edit Organization Records"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/view-organization-records
rm:view-organization-records rdf:type owl:Class ;
rdfs:label "View Organization Records"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/edit-users
rm:edit-users rdf:type owl:Class ;
rdfs:label "Edit Users"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/import-codelists
rm:import-codelists rdf:type owl:Class ;
rdfs:label "Import Codelists"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/publish-records
rm:publish-records rdf:type owl:Class ;
rdfs:label "Publish Records"@en .

### http://onto.fel.cvut.cz/ontologies/record-manager/reject-records
rm:reject-records rdf:type owl:Class ;
rdfs:label "Reject Records"@en .


0 comments on commit 068949e

Please sign in to comment.