dhavalshah9131 commented on code in PR #1229:
URL: https://github.com/apache/ranger/pull/1229#discussion_r4045959438


##########
security-admin/src/main/java/org/apache/ranger/rest/SecurityZoneREST.java:
##########
@@ -695,20 +697,60 @@ private void blockAdminFromKMSService(RangerSecurityZone 
securityZone) {
 
             if (serviceMap != null) {
                 for (String serviceName : serviceMap.keySet()) {
-                    XXService xService = 
daoManager.getXXService().findByName(serviceName);
-
-                    if (xService != null) {
-                        XXServiceDef xServiceDef = 
daoManager.getXXServiceDef().getById(xService.getType());
+                    String serviceType = 
daoManager.getXXServiceDef().findServiceDefTypeByServiceName(serviceName);
 
-                        if 
(EmbeddedServiceDefsUtil.KMS_IMPL_CLASS_NAME.equals(xServiceDef.getImplclassname()))
 {
-                            throw restErrorUtil.createRESTException("KMS 
Services/Service-Defs are not accessible for Zone operations", 
MessageEnums.OPER_NOT_ALLOWED_FOR_ENTITY);
-                        }
+                    if 
(EmbeddedServiceDefsUtil.EMBEDDED_SERVICEDEF_KMS_NAME.equals(serviceType)) {

Review Comment:
   Hi @vyommani ,
   I have added the check of implclassname.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to