@Test public void testSavePatientListShouldUsePrivileges() throws Exception { Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer")); PatientList pList = new PatientList(); pList.setName("TestList3"); pList.setDescription("Third Test List"); pList.setCreator(Context.getUserContext().getAuthenticatedUser()); pList.setDateCreated(new java.util.Date()); pList.setUuid("68547121-1b70-465c-99ee-c9dfd95e7d30"); pList.setRetired(Boolean.FALSE); pList.setSearchQuery("test Query"); try { s.savePatientList(pList); fail("No privileges required for savePatientList"); } catch (APIAuthenticationException e) { Context.getUserContext().addProxyPrivilege("Add Patient Lists"); Context.getUserContext().addProxyPrivilege("View Patient Lists"); Context.getUserContext().addProxyPrivilege("View Users"); s.savePatientList(pList); } }
@Override public PatientList savePatientList(PatientList patientList) { return dao.savePatientList(patientList); }
PatientListServiceImpl implements PatientListService { @Override public PatientList savePatientList(PatientList patientList) { return dao.savePatientList(patientList); } }
PatientListServiceImpl implements PatientListService { @Override public PatientList savePatientList(PatientList patientList) { return dao.savePatientList(patientList); }  }
PatientListServiceImpl implements PatientListService { @Override public PatientList savePatientList(PatientList patientList) { return dao.savePatientList(patientList); }  @Override void setPatientListDAO(PatientListDAO dao); @Override PatientList savePatientList(PatientList patientList); @Override PatientList getPatientList(Integer id); @Override List<PatientList> getPatientListByName(String name); @Override PatientList getPatientListByUuid(String uuid); @Override List<PatientList> getPatientListByEncounterType(EncounterType encounterType); @Override List<PatientList> getAllPatientList(boolean includeRetired); @Override List<Encounter> getEncountersInPatientList(PatientList patientList); @Override List<Patient> getPatientsInPatientList(PatientList patientList); @Override PatientList updatePatientList(PatientList patientList); @Override void deletePatientList(PatientList patientList); @Override void onStartup(); @Override void onShutdown(); }
PatientListServiceImpl implements PatientListService { @Override public PatientList savePatientList(PatientList patientList) { return dao.savePatientList(patientList); }  @Override void setPatientListDAO(PatientListDAO dao); @Override PatientList savePatientList(PatientList patientList); @Override PatientList getPatientList(Integer id); @Override List<PatientList> getPatientListByName(String name); @Override PatientList getPatientListByUuid(String uuid); @Override List<PatientList> getPatientListByEncounterType(EncounterType encounterType); @Override List<PatientList> getAllPatientList(boolean includeRetired); @Override List<Encounter> getEncountersInPatientList(PatientList patientList); @Override List<Patient> getPatientsInPatientList(PatientList patientList); @Override PatientList updatePatientList(PatientList patientList); @Override void deletePatientList(PatientList patientList); @Override void onStartup(); @Override void onShutdown();  }