-
Notifications
You must be signed in to change notification settings - Fork 6
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
BAH-4062 | Add Privilege Checks for Task Resource #66
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a50f676
BAH-4062 | Add Privileges for Task resource
mohan-13 0c34852
BAH-4062 | Add Privilege checks at service method
mohan-13 bc26421
BAH-4062 | Refactor. Rewrite bean definition to include serviceInterc…
mohan-13 1eba9ee
BAH-4062 | Refactor. Reuse existing bean instance instead of creating…
mohan-13 8521b7b
BAH-4062 | Fix. Use JFrog URL for OMRS Maven Repo
mohan-13 5b870a4
BAH-4062 | Fix. Plugin repository URL
mohan-13 42f4ced
Revert "BAH-4062 | Fix. Plugin repository URL"
mohan-13 dbe9dd2
Revert "BAH-4062 | Fix. Use JFrog URL for OMRS Maven Repo"
mohan-13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
any specific reason of using this instead of https://github.com/openmrs/openmrs-module-fhir2/blob/master/api/src/main/java/org/openmrs/module/fhir2/api/dao/impl/FhirTaskDaoImpl.java?
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.
Im not very sure of the reasoning, the only thing I can see is that the extension class supports additional methods