From 035403495c43283c390b15933237262abec16ac2 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 9 May 2017 16:45:47 +0530 Subject: [PATCH] made default stat permission as constant --- .../admin/DeviceAccessAuthorizationAdminServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java index 57c1ce5f69..035caa3a18 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java @@ -45,6 +45,7 @@ import java.util.List; public class DeviceAccessAuthorizationAdminServiceImpl implements DeviceAccessAuthorizationAdminService { private static final Log log = LogFactory.getLog(DeviceAccessAuthorizationAdminServiceImpl.class); + private static final String DEFAULT_STAT_PERMISSION = "/permission/admin/device-mgt/device/realtime_analytics"; @POST @Override @@ -97,9 +98,9 @@ public class DeviceAccessAuthorizationAdminServiceImpl implements DeviceAccessAu @Override public Response isAuthorizedForStat(AuthorizationRequest authorizationRequest) { List permissions = new ArrayList<>(); - permissions.add("/permission/admin/device-mgt/device/realtime_analytics"); + permissions.add(DEFAULT_STAT_PERMISSION); authorizationRequest.setPermissions(permissions); - return isAuthorizedForStat(authorizationRequest); + return isAuthorized(authorizationRequest); } }