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 57c1ce5f693..035caa3a180 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); } }