[#CSM-5 User privileges check]

https://issues.openmrs.org/browse/CSM-5 | refactored GeneratingJSON#generateJson() and checked for privileges
=> Still testing