-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAH-4062 | Add Privilege Checks for Task Resource (#66)
* BAH-4062 | Add Privileges for Task resource * BAH-4062 | Add Privilege checks at service method * BAH-4062 | Refactor. Rewrite bean definition to include serviceInterceptors * BAH-4062 | Refactor. Reuse existing bean instance instead of creating new. * BAH-4062 | Fix. Use JFrog URL for OMRS Maven Repo * BAH-4062 | Fix. Plugin repository URL * Revert "BAH-4062 | Fix. Plugin repository URL" This reverts commit 5b870a4. * Revert "BAH-4062 | Fix. Use JFrog URL for OMRS Maven Repo" This reverts commit 8521b7b.
- Loading branch information
Showing
7 changed files
with
109 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
api/src/main/java/org/openmrs/module/fhirExtension/service/TaskService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,32 @@ | ||
package org.openmrs.module.fhirExtension.service; | ||
|
||
import org.openmrs.module.fhir2.model.FhirTask; | ||
import org.openmrs.annotation.Authorized; | ||
import org.openmrs.module.fhirExtension.model.Task; | ||
import org.openmrs.module.fhirExtension.model.TaskSearchRequest; | ||
import org.springframework.stereotype.Component; | ||
import org.openmrs.module.fhirExtension.utils.PrivilegeConstants; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
@Component | ||
@Transactional | ||
public interface TaskService { | ||
|
||
@Authorized({ PrivilegeConstants.ADD_TASKS, PrivilegeConstants.EDIT_TASKS }) | ||
Task saveTask(Task task); | ||
|
||
@Authorized({ PrivilegeConstants.ADD_TASKS, PrivilegeConstants.EDIT_TASKS }) | ||
List<Task> saveTask(List<Task> tasks); | ||
|
||
@Authorized({ PrivilegeConstants.GET_TASKS }) | ||
List<Task> getTasksByVisitFilteredByTimeFrame(String visitUuid, Date startTime, Date endTime); | ||
|
||
@Authorized({ PrivilegeConstants.GET_TASKS }) | ||
List<Task> getTasksByPatientUuidsByTimeFrame(List<String> patientUuids, Date startTime, Date endTime); | ||
|
||
@Authorized({ PrivilegeConstants.GET_TASKS }) | ||
List<Task> getTasksByUuids(List<String> listOdUuids); | ||
|
||
@Authorized({ PrivilegeConstants.GET_TASKS }) | ||
List<Task> searchTasks(TaskSearchRequest taskSearchRequest); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
api/src/main/java/org/openmrs/module/fhirExtension/utils/PrivilegeConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.openmrs.module.fhirExtension.utils; | ||
|
||
public class PrivilegeConstants { | ||
|
||
private PrivilegeConstants() { | ||
} | ||
|
||
public static final String GET_TASKS = "Get Tasks"; | ||
|
||
public static final String EDIT_TASKS = "Edit Tasks"; | ||
|
||
public static final String ADD_TASKS = "Add Tasks"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<module configVersion="1.2"> | ||
|
||
<!-- Base Module Properties --> | ||
<id>${project.parent.artifactId}</id> | ||
<name>${project.parent.name}</name> | ||
|
@@ -13,35 +13,35 @@ | |
</description> | ||
|
||
<activator>org.openmrs.module.fhirExtension.FhirExtensionModuleActivator</activator> | ||
|
||
<!-- <updateURL>https://modules.openmrs.org/modules/download/@MODULE_ID@/update.rdf</updateURL> --> | ||
<!-- /Base Module Properties --> | ||
|
||
<require_version>${openmrsPlatformVersion}</require_version> | ||
|
||
<!-- Extensions --> | ||
<!-- <extension>--> | ||
<!-- <point>org.openmrs.admin.list</point>--> | ||
<!-- <class>${MODULE_PACKAGE}.extension.html.AdminList</class>--> | ||
<!-- </extension>--> | ||
|
||
|
||
<!-- AOP | ||
<advice> | ||
<point>org.openmrs.api.FormService</point> | ||
<class>@[email protected]</class> | ||
</advice> | ||
/AOP --> | ||
<!-- Required Privileges | ||
|
||
|
||
<!-- Required Privileges | ||
<privilege> | ||
<name>Form Entry</name> | ||
<description>Allows user to access Form Entry pages/functions</description> | ||
</privilege> | ||
/Required Privileges --> | ||
|
||
<!-- Required Global Properties | ||
<!-- Required Global Properties | ||
<globalProperty> | ||
<property>@[email protected]</property> | ||
<defaultValue></defaultValue> | ||
|
@@ -52,17 +52,17 @@ | |
</description> | ||
</globalProperty> | ||
/Required Global Properties --> | ||
|
||
<!-- Servlets --> | ||
<!-- Accessed through the url /pageContext()/moduleServlet/<moduleId>/<servlet-name> | ||
<!-- Accessed through the url /pageContext()/moduleServlet/<moduleId>/<servlet-name> | ||
<servlet> | ||
<servlet-name>formDownload</servlet-name> | ||
<servlet-class>@[email protected]</servlet-class> | ||
</servlet> | ||
--> | ||
<!-- /Servlets --> | ||
|
||
|
||
<!-- Internationalization --> | ||
<!-- All message codes should start with @MODULE_ID@.* --> | ||
<aware_of_modules> | ||
|
@@ -97,6 +97,18 @@ | |
<name>Export Non Anonymised Patient Data</name> | ||
<description>Ability to bulk-export patient data that has NOT been anonymised, in FHIR JSON format</description> | ||
</privilege> | ||
<privilege> | ||
<name>Get Tasks</name> | ||
<description>Ability to get FHIR Tasks</description> | ||
</privilege> | ||
<privilege> | ||
<name>Add Tasks</name> | ||
<description>Ability to create FHIR Tasks</description> | ||
</privilege> | ||
<privilege> | ||
<name>Edit Tasks</name> | ||
<description>Ability to edit FHIR Tasks</description> | ||
</privilege> | ||
|
||
<globalProperty> | ||
<property>labEntry.visitType</property> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters