org.openmrs.util.PrivilegeConstants cannot be resolved


(Sai Sandeep Mutyala) #1

I am working on fixing a bug, which requires me to use the class PrivilegeConstants, but I get the above error. How do I fix it? Also where can I find the docs (or java file) for the said class.


(Sai Sandeep Mutyala) #2

Found the docs link: https://docs.openmrs.org/doc/org/openmrs/util/PrivilegeConstants.html The bug fix I’m working on requires me to check whether the user has the privileges to add atlas markers. There seems to be no such constant in the PrivilegeConstants class. So even if I manage to fix the initial error, how do I perform the mentioned check?


(Sai Sandeep Mutyala) #3

I still cannot fix the initial error, but it looks like the privilege is defined in config.xml of the module. So now I can progress with the issue again. I’d still like to know why PrivilegeConstants cannot be resolved. Thank you.


(Daniel Kayiwa) #4

Which OpenMRS platform version are you using?


(Sai Sandeep Mutyala) #5

I’m using the Reference Application 2.8.0 created using the OpenMRS SDK.


(Daniel Kayiwa) #6

Can you share the build log at pastebin.com?


(Sai Sandeep Mutyala) #7

Here you are: https://pastebin.com/MXqyd1Ww


(Daniel Kayiwa) #8

Can you raise a pull request and we look at your changes?


(Sai Sandeep Mutyala) #9

Here’s the PR: https://github.com/openmrs/openmrs-module-atlas/pull/10/files


(Daniel Kayiwa) #10

According to this https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/util/PrivilegeConstants.java#L20 that class was introduced in platform 1.8

So change the openmrs dependency version to 1.8.0


(Sai Sandeep Mutyala) #11

That fixed it! Thank you!