diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/permissions.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/permissions.xml index df2b2cf629..5a63c7f533 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/permissions.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/permissions.xml @@ -32,7 +32,7 @@ get certificate in the database - /device-mgt/admin/certificate/GetSignCSR + /device-mgt/certificate/GetSignCSR /certificates/scep/signcsr POST emm_admin diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java index 2b8a075f9b..1c23be2544 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java @@ -93,7 +93,7 @@ public interface ActivityInfoProviderService { message = "Internal Server Error. \n Server error occurred while fetching activity data.", response = ErrorResponse.class) }) - @Permission(name = "View Activities", permission = "/device-mgt/activities/view") + @Permission(name = "View Activities", permission = "/device-mgt/devices/owning/view") Response getActivity( @ApiParam( name = "id", @@ -154,7 +154,7 @@ public interface ActivityInfoProviderService { message = "Internal Server Error. \n Server error occurred while fetching activity data.", response = ErrorResponse.class) }) - @Permission(name = "View Activities", permission = "/device-mgt/activities/view") + @Permission(name = "View Activities", permission = "/device-mgt/devices/owning/view") Response getActivities( @ApiParam( name = "since", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java index b774a9598c..0a450b6ec0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java @@ -82,7 +82,7 @@ public interface ConfigurationManagementService { "platform configuration.", response = ErrorResponse.class) }) - @Permission(name = "View Configurations", permission = "/device-mgt/configuration/view") + @Permission(name = "View Configurations", permission = "/device-mgt/configurations/view") Response getConfiguration( @ApiParam( name = "If-Modified-Since", @@ -128,7 +128,7 @@ public interface ConfigurationManagementService { "Server error occurred while modifying general platform configuration.", response = ErrorResponse.class) }) - @Permission(name = "Manage configurations", permission = "/device-mgt/configuration/manage") + @Permission(name = "Manage configurations", permission = "/device-mgt/configurations/manage") Response updateConfiguration( @ApiParam( name = "configuration", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index fd85ca7b27..e1240f9dd4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -93,7 +93,7 @@ public interface DeviceManagementService { message = "Internal Server Error. \n Server error occurred while fetching the device list.", response = ErrorResponse.class) }) - @Permission(name = "View Devices", permission = "/device-mgt/devices/view") + @Permission(name = "View Devices", permission = "/device-mgt/devices/owning/view") Response getDevices( @ApiParam( name = "name", @@ -200,7 +200,7 @@ public interface DeviceManagementService { "Server error occurred while retrieving information requested device.", response = ErrorResponse.class) }) - @Permission(name = "View Devices", permission = "/device-mgt/devices/view") + @Permission(name = "View Devices", permission = "/device-mgt/devices/owning/view") Response getDevice( @ApiParam( name = "type", @@ -282,7 +282,7 @@ public interface DeviceManagementService { "Server error occurred while retrieving feature list of the device.", response = ErrorResponse.class) }) - @Permission(name = "View Devices", permission = "/device-mgt/devices/view") + @Permission(name = "View Devices", permission = "/device-mgt/devices/owning/view") Response getFeaturesOfDevice( @ApiParam( name = "type", @@ -358,7 +358,7 @@ public interface DeviceManagementService { "Server error occurred while enrolling the device.", response = ErrorResponse.class) }) - @Permission(name = "View Devices", permission = "/device-mgt/devices/view") + @Permission(name = "View Devices", permission = "/device-mgt/devices/owning/view") Response searchDevices( @ApiParam( name = "offset", @@ -437,7 +437,7 @@ public interface DeviceManagementService { "Server error occurred while retrieving installed application list of the device.", response = ErrorResponse.class) }) - @Permission(name = "View Devices", permission = "/device-mgt/devices/view") + @Permission(name = "View Devices", permission = "/device-mgt/devices/owning/view") Response getInstalledApplications( @ApiParam( name = "type", @@ -533,7 +533,7 @@ public interface DeviceManagementService { "Server error occurred while retrieving operation list scheduled for the device.", response = ErrorResponse.class) }) - @Permission(name = "View Devices", permission = "/device-mgt/devices/view") + @Permission(name = "View Devices", permission = "/device-mgt/devices/owning/view") Response getDeviceOperations( @ApiParam( name = "type", @@ -631,7 +631,7 @@ public interface DeviceManagementService { response = ErrorResponse.class) } ) - @Permission(name = "View Devices", permission = "/device-mgt/devices/view") + @Permission(name = "View Devices", permission = "/device-mgt/devices/owning/view") Response getEffectivePolicyOfDevice( @ApiParam( name = "type", @@ -683,7 +683,7 @@ public interface DeviceManagementService { response = ErrorResponse.class) } ) - @Permission(name = "View Devices", permission = "/device-mgt/devices/view") + @Permission(name = "View Devices", permission = "/device-mgt/devices/owning/view") Response getComplianceDataOfDevice( @ApiParam( name = "type", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java index b8141d45fa..b9a24fbafe 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java @@ -79,7 +79,7 @@ public interface DeviceTypeManagementService { response = ErrorResponse.class) } ) - @Permission(name = "View Device Types", permission = "/device-mgt/devices/view") + @Permission(name = "View Device Types", permission = "/device-mgt/devices/owning/view") Response getDeviceTypes( @ApiParam( name = "If-Modified-Since", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java index 2fa4297881..cf5b2882fa 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java @@ -82,7 +82,7 @@ public interface GroupManagementService { // // @GET // @Path("/{groupName}/devices") -// @Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/admin/groups/roles"}) +// @Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/groups/roles"}) // Response getDevicesOfGroup(@PathParam("groupName") String groupName, @QueryParam("offset") int offset, // @QueryParam("limit") int limit); // diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java index 81449f4b13..e673260659 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java @@ -86,7 +86,7 @@ public interface DeviceManagementAdminService { message = "Internal Server Error. \n Server error occurred while fetching the device list.", response = ErrorResponse.class) }) - @Permission(name = "View Devices", permission = "/device-mgt/admin/devices/view") + @Permission(name = "View Devices", permission = "/device-mgt/devices/owning/view") Response getDevicesByName( @ApiParam( name = "name", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java index 596f998845..6b18ea8367 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java @@ -69,7 +69,7 @@ public interface UserManagementAdminService { "Server error occurred while updating credentials of the user.", response = ErrorResponse.class) }) - @Permission(name = "View Users", permission = "/device-mgt/admin/users/view") + @Permission(name = "View Users", permission = "/device-mgt/users/manage") Response resetUserPassword( @ApiParam( name = "username", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/permissions.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/permissions.xml index 050e9089cf..7c77cd9bf4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/permissions.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/permissions.xml @@ -45,334 +45,334 @@ Devices - /device-mgt/admin/devices + /device-mgt/devices / GET List devices - /device-mgt/admin/devices/List + /device-mgt/devices/List /devices GET Search devices - /device-mgt/admin/devices/Search + /device-mgt/devices/Search /devices/search-devices POST View device - /device-mgt/admin/devices/View + /device-mgt/devices/View /devices/*/* GET View device info - /device-mgt/admin/devices/View + /device-mgt/devices/View /devices/*/*/info GET View device applications - /device-mgt/admin/devices/View-Applications + /device-mgt/devices/View-Applications /devices/*/*/applications GET View device effective-policy - /device-mgt/admin/devices/View-Active-Policy + /device-mgt/devices/View-Active-Policy /devices/*/*/effective-policy GET View devices feature - /device-mgt/admin/devices/View-Features + /device-mgt/devices/View-Features /devices/*/*/features GET View device operations - /device-mgt/admin/devices/View-Operations + /device-mgt/devices/View-Operations /devices/*/*/operations GET View Compliance Data - /device-mgt/admin/devices/View-Compliance-Data + /device-mgt/devices/View-Compliance-Data /devices/*/*/compliance-data GET List all devices - /device-mgt/admin/devices/Admin-View + /device-mgt/devices/Admin-View /admin/devices GET View device types - /device-mgt/admin/devices/Admin-DeviceType-View + /device-mgt/devices/Admin-DeviceType-View /admin/device-types GET Policies - /device-mgt/admin/policies + /device-mgt/policies / GET List policies - /device-mgt/admin/policies/List + /device-mgt/policies/List /policies GET Add Policy - /device-mgt/admin/policies/Add + /device-mgt/policies/Add /policies POST Activate policy - /device-mgt/admin/policies/Activate-Policy + /device-mgt/policies/Activate-Policy /policies/activate-policy PUT Deactivate Policy - /device-mgt/admin/policies/Deactivate-Policy + /device-mgt/policies/Deactivate-Policy /policies/deactivate-policy PUT Remove Policy - /device-mgt/admin/policies/Remove + /device-mgt/policies/Remove /policies/remove-policy POST View Policy - /device-mgt/admin/policies/View + /device-mgt/policies/View /policies/* GET Update Policy - /device-mgt/admin/policies/Update + /device-mgt/policies/Update /policies/* PUT Update Policy - /device-mgt/admin/policies/Update + /device-mgt/policies/Update /policies/apply-changes PUT Update Policy - /device-mgt/admin/policies/Change-Priority + /device-mgt/policies/Change-Priority /policies/priorities PUT Notifications - /device-mgt/admin/notifications + /device-mgt/notifications / GET View notifications - /device-mgt/admin/notifications/View + /device-mgt/notifications/View /notifications GET Mark checked notifications - /device-mgt/admin/notifications/View + /device-mgt/notifications/View /notifications/*/mark-checked PUT Users - /device-mgt/admin/users + /device-mgt/users / GET List users - /device-mgt/admin/users/List + /device-mgt/users/List /users GET Add user - /device-mgt/admin/users/Add + /device-mgt/users/Add /users POST List users - /device-mgt/admin/users/Search + /device-mgt/users/Search /users/search/usernames GET Remove user - /device-mgt/admin/users/Remove + /device-mgt/users/Remove /users/* DELETE View user - /device-mgt/admin/users/View + /device-mgt/users/View /users/* GET Update user - /device-mgt/admin/users/Update + /device-mgt/users/Update /users/* PUT Update user credentials - /device-mgt/admin/users/Change-Password + /device-mgt/users/Change-Password /users/*/credentials PUT View assigned role - /device-mgt/admin/roles/Assigned-Roles + /device-mgt/roles/Assigned-Roles /users/*/roles GET Change any user credentials - /device-mgt/admin/users/Change-Password-Any + /device-mgt/users/Change-Password-Any /admin/users/*/credentials POST Send invitation mail - /device-mgt/admin/users/Send-invitations + /device-mgt/users/Send-invitations /users/send-invitation POST Roles - /device-mgt/admin/roles + /device-mgt/roles / GET List roles - /device-mgt/admin/roles/List + /device-mgt/roles/List /roles GET Add role - /device-mgt/admin/roles/Add + /device-mgt/roles/Add /roles POST Remove role - /device-mgt/admin/roles/Remove + /device-mgt/roles/Remove /roles/* DELETE View role - /device-mgt/admin/roles/View + /device-mgt/roles/View /roles/* GET Update role - /device-mgt/admin/roles/Update + /device-mgt/roles/Update /roles/* PUT View role permissions - /device-mgt/admin/roles/View-Permission + /device-mgt/roles/View-Permission /roles/*/permissions GET Add Users to role - /device-mgt/admin/roles/Add-Users + /device-mgt/roles/Add-Users /roles/*/users PUT Configurations - /device-mgt/admin/general-configs + /device-mgt/general-configs / GET View configuration - /device-mgt/admin/general-configuration/View + /device-mgt/general-configuration/View /configuration GET Update configuration - /device-mgt/admin/general-configuration/Update + /device-mgt/general-configuration/Update /configuration PUT Activities - /device-mgt/admin/activities + /device-mgt/activities / GET View Activities - /device-mgt/admin/activities/View + /device-mgt/devices/owning/view /activities GET View Activity Details - /device-mgt/admin/activities/View + /device-mgt/devices/owning/view /activities/* GET Applications - /device-mgt/admin/applications + /device-mgt/applications / GET Install Applications - /device-mgt/admin/application/Install + /device-mgt/application/Install /admin/applications/install-application POST Uninstall-Applications - /device-mgt/admin/application/Uninstall + /device-mgt/application/Uninstall /admin/applications/uninstall-application POST diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/group/mgt/DeviceGroupConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/group/mgt/DeviceGroupConstants.java index 24c4089b24..aab0fc16f3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/group/mgt/DeviceGroupConstants.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/group/mgt/DeviceGroupConstants.java @@ -67,7 +67,7 @@ public class DeviceGroupConstants { public static class Permissions { public static final String[] DEFAULT_ADMIN_PERMISSIONS = - {"/permission/device-mgt/admin/groups", "/permission/device-mgt/user/groups"}; + {"/permission/device-mgt/groups", "/permission/device-mgt/user/groups"}; public static final String[] DEFAULT_OPERATOR_PERMISSIONS = {"/permission/device-mgt/user/groups/device_operation"}; public static final String[] DEFAULT_STATS_MONITOR_PERMISSIONS = diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/authorization/DeviceAccessAuthorizationServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/authorization/DeviceAccessAuthorizationServiceImpl.java index a5ac284b99..31d1be6658 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/authorization/DeviceAccessAuthorizationServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/authorization/DeviceAccessAuthorizationServiceImpl.java @@ -47,7 +47,7 @@ import java.util.Map; */ public class DeviceAccessAuthorizationServiceImpl implements DeviceAccessAuthorizationService { - private final static String CDM_ADMIN_PERMISSION = "/device-mgt/admin"; + private final static String CDM_ADMIN_PERMISSION = "/device-mgt/devices/any/permitted-actions-upon-owning-device"; private final static String CDM_ADMIN = "Device Management Administrator"; private static Log log = LogFactory.getLog(DeviceAccessAuthorizationServiceImpl.class); @@ -246,7 +246,7 @@ public class DeviceAccessAuthorizationServiceImpl implements DeviceAccessAuthori private boolean addAdminPermissionToRegistry() throws PermissionManagementException { Permission permission = new Permission(); permission.setName(CDM_ADMIN); - permission.setPath(CDM_ADMIN_PERMISSION); + permission.setPath(PermissionUtils.getAbsolutePermissionPath(CDM_ADMIN_PERMISSION)); return PermissionUtils.putPermission(permission); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/device-api.jag b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/device-api.jag index ecb9806b5d..d0fc9c4f70 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/device-api.jag +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/device-api.jag @@ -152,7 +152,7 @@ if (!user) { result = responsePayload.responseText; }); } else if (uriMatcher.match("/{context}/api/devices/")) { - if (userModule.isAuthorized("/permission/admin/device-mgt/admin/devices/list")) { + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/list")) { result = deviceModule.listDevices(); } else { response.sendError(403); @@ -161,7 +161,7 @@ if (!user) { elements = uriMatcher.elements(); deviceId = elements.deviceId; type = elements.type; - if (userModule.isAuthorized("/permission/admin/device-mgt/admin/devices/list")) { + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/list")) { result = deviceModule.viewDevice(type, deviceId); }else { response.sendError(403); @@ -171,7 +171,7 @@ if (!user) { deviceId = elements.deviceId; type = elements.type; operation = elements.operation; - if (userModule.isAuthorized("/permission/admin/device-mgt/admin/devices/operation")) { + if (userModule.isAuthorized("/permission/admin/device-mgt/devices/operation")) { result = deviceModule.performOperation(deviceId, operation, [], type); } else { response.sendError(403); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag index 465e896181..7303a5ee8c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag @@ -98,7 +98,7 @@ if (uriMatcher.match("/{context}/api/user/authenticate")) { /* @Deprecated */ - if (userModule.isAuthorized("/permission/admin/device-mgt/admin/user/invite")) { + if (userModule.isAuthorized("/permission/admin/device-mgt/user/invite")) { elements = uriMatcher.elements(); username = elements.username; userModule.inviteUser(username); @@ -109,7 +109,7 @@ if (uriMatcher.match("/{context}/api/user/authenticate")) { /* @Deprecated */ - if (userModule.isAuthorized("/permission/admin/device-mgt/admin/user/add")) { + if (userModule.isAuthorized("/permission/admin/device-mgt/user/add")) { addUserFormData = request.getContent(); username = addUserFormData.username; firstname = addUserFormData.firstname; @@ -160,7 +160,7 @@ if (uriMatcher.match("/{context}/api/user/authenticate")) { /* @Deprecated */ - if (userModule.isAuthorized("/permission/admin/device-mgt/admin/user/remove")) { + if (userModule.isAuthorized("/permission/admin/device-mgt/user/remove")) { elements = uriMatcher.elements(); username = elements.username; try { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js index dde8854bbb..222db658b8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js @@ -396,25 +396,25 @@ var userModule = function () { publicMethods.getUIPermissions = function () { var permissions = {}; - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/devices/list")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/list")) { permissions["LIST_DEVICES"] = true; } if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/devices/list")) { permissions["LIST_OWN_DEVICES"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/groups/list")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/list")) { permissions["LIST_ALL_GROUPS"] = true; } if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/groups/list")) { permissions["LIST_GROUPS"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/users/list")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/users/list")) { permissions["LIST_USERS"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/roles/list")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/roles/list")) { permissions["LIST_ROLES"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/policies/list")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/policies/list")) { permissions["LIST_ALL_POLICIES"] = true; } if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/policies/list")) { @@ -426,28 +426,28 @@ var userModule = function () { if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/groups/add")) { permissions["ADD_GROUP"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/users/add")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/users/add")) { permissions["ADD_USER"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/users/remove")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/users/remove")) { permissions["REMOVE_USER"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/roles/add")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/roles/add")) { permissions["ADD_ROLE"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/policies/add")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/policies/add")) { permissions["ADD_ADMIN_POLICY"] = true; } if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/policies/add")) { permissions["ADD_POLICY"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/policies/priority")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/policies/priority")) { permissions["CHANGE_POLICY_PRIORITY"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/dashboard/view")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/dashboard/view")) { permissions["VIEW_DASHBOARD"] = true; } - if (publicMethods.isAuthorized("/permission/admin/device-mgt/admin/platform-configs/view")) { + if (publicMethods.isAuthorized("/permission/admin/device-mgt/platform-configs/view")) { permissions["TENANT_CONFIGURATION"] = true; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.hbs index b2411eac33..4d0f953422 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.hbs @@ -23,77 +23,87 @@ +
  • + + Certificates + +
  • - - - - - Add Certificate + Add
  • {{/zone}} {{#zone "content"}} - -
    -
    - -
    -
    -

    Add Certificate

    -

    Please note that * sign represents required fields of data.

    -
    -
    -
    - + {{#if isAuthorized}} + +
    +
    + +
    +
    +

    Add Certificate

    +

    Please note that * sign represents required fields of data.

    +
    +
    +
    + - -
    -
    - -
    - -
    - + +
    +
    + +
    + +
    + +
    -
    -
    -
    -
    - +
    +
    +
    + +
    -
    - -
    - + + {{else}} +

    + Permission Denied +

    +
    + You not authorized to enter Certificate Management Section. +
    + {{/if}} {{/zone}} {{#zone "bottomJs"}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js index 6244fc1f09..6099b8a845 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificate.create/create.js @@ -26,7 +26,8 @@ function onRequest(context) { // var log = new Log("units/user-create/create.js"); var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var mdmProps = require("/app/modules/conf-reader/main.js")["conf"]; - + var viewModel = {}; + viewModel.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/certificates/manage"); var response = userModule.getRolesByUserStore(); if (response["status"] == "success") { viewModel["roles"] = response["content"]; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs index 6bb4257acc..6d2322f82c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.certificates/certificates.hbs @@ -24,14 +24,24 @@
  • - + + Certificate + +
  • +{{/zone}} + +{{#zone "navbarActions"}} + {{#if removePermitted}} +
  • + - Add Certificate - -
  • + Add Certificate + + + {{/if}} {{/zone}} {{#zone "content"}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.hbs index 5efc9b61e5..d3b2f15329 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.hbs @@ -38,6 +38,7 @@ {{/zone}} {{#zone "content"}} + {{#if canManage}}
    @@ -96,6 +97,7 @@ Role name is required, should be in minimum 3 characters long and not include any whitespaces.
    + {{#if canViewUsers}} @@ -104,6 +106,7 @@
    + {{/if}}

    @@ -134,6 +137,14 @@
    + {{else}} +

    + Permission Denied +

    +
    + You not authorized to enter Role Management Section. +
    + {{/if}} {{/zone}} {{#zone "bottomJs"}} {{js "js/bottomJs.js"}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.js index 909a3ee303..ca91072d12 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/create.js @@ -20,16 +20,24 @@ * Returns the dynamic state to be populated by add-user page. * * @param context Object that gets updated with the dynamic state of this page to be presented - * @returns {*} A context object that returns the dynamic state of this page to be presented + * @returns {*} A displayData object that returns the dynamic state of this page to be presented */ function onRequest(context) { var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"]; + var displayData = {}; - context["userStores"] = userModule.getSecondaryUserStores(); - context["roleNameJSRegEx"] = deviceMgtProps["roleValidationConfig"]["roleNameJSRegEx"]; - context["roleNameHelpText"] = deviceMgtProps["roleValidationConfig"]["roleNameHelpMsg"]; - context["roleNameRegExViolationErrorMsg"] = deviceMgtProps["roleValidationConfig"]["roleNameRegExViolationErrorMsg"]; + displayData["userStores"] = userModule.getSecondaryUserStores(); + displayData["roleNameJSRegEx"] = deviceMgtProps["roleValidationConfig"]["roleNameJSRegEx"]; + displayData["roleNameHelpText"] = deviceMgtProps["roleValidationConfig"]["roleNameHelpMsg"]; + displayData["roleNameRegExViolationErrorMsg"] = deviceMgtProps["roleValidationConfig"]["roleNameRegExViolationErrorMsg"]; - return context; + if (userModule.isAuthorized("/permission/admin/device-mgt/roles/manage")) { + displayData.canManage = true; + } + if (userModule.isAuthorized("/permission/admin/device-mgt/users/view")) { + displayData.canViewUsers = true; + } + + return displayData; } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.hbs index f7fdaf470b..9867540a55 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.hbs @@ -37,110 +37,123 @@ {{#zone "content"}} {{#if canManage}} - -
    -
    - -
    -
    -

    Add User

    -

    Please note that * sign represents required fields of data.

    -
    -
    -
    - - -
    - -
    - -
    - - - -
    - -
    - - - -
    - -
    - - - -
    - -
    - - - - -
    - -
    - + +
    +
    + +
    +
    +

    Add User

    +

    Please note that * sign represents required fields of data.

    +
    +
    +
    + + +
    + +
    + +
    + + + +
    + +
    + + + +
    + +
    + + + +
    + +
    + + + + +
    + + {{#if canViewRoles}} +
    + +
    + {{/if}}
    +
    +
    -
    -
    -
    - {{else}}

    Permission Denied diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.js index 978e12763f..e1c4b583bd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/create.js @@ -35,6 +35,9 @@ function onRequest() { if (userModule.isAuthorized("/permission/admin/device-mgt/users/manage")) { page.canManage = true; } + if (userModule.isAuthorized("/permission/admin/device-mgt/roles/view")) { + page.canViewRoles = true; + } var userStores = userModule.getSecondaryUserStores(); page["userStores"] = userStores; page["charLimit"] = devicemgtProps["usernameLength"]; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js index 3f6da52477..119f773318 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js @@ -26,6 +26,8 @@ function onRequest(context) { var types = {}; types.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage"); + types.isAuthorizedViewUsers = userModule.isAuthorized("/permission/admin/device-mgt/roles/view"); + types.isAuthorizedViewRoles = userModule.isAuthorized("/permission/admin/device-mgt/users/view"); types["types"] = []; var typesListResponse = deviceModule.getDeviceTypes(); if (typesListResponse["status"] == "success") { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css index a126a734fd..70ac36766d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css @@ -18,154 +18,154 @@ font-family: "Roboto"; font-style: italic; font-weight: 100; - src: local("Roboto Thin Italic"), local("Roboto-ThinItalic"), url(../fonts/Roboto/Roboto-ThinItalic.woff2) format("woff2"), url(../fonts/Roboto/Roboto-ThinItalic.woff) format("woff"), url(../fonts/Roboto/Roboto-ThinItalic.ttf) format("truetype"), url(../fonts/Roboto/Roboto-ThinItalic.eot), url(../fonts/Roboto/Roboto-ThinItalic.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-ThinItalic.svg#Roboto) format("svg"); + src: local("Roboto Thin Italic"), local("Roboto-ThinItalic"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-ThinItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-ThinItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-ThinItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-ThinItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-ThinItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-ThinItalic-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: italic; font-weight: 300; - src: local("Roboto Light Italic"), local("Roboto-LightItalic"), url(../fonts/Roboto/Roboto-LightItalic.woff2) format("woff2"), url(../fonts/Roboto/Roboto-LightItalic.woff) format("woff"), url(../fonts/Roboto/Roboto-LightItalic.ttf) format("truetype"), url(../fonts/Roboto/Roboto-LightItalic.eot), url(../fonts/Roboto/Roboto-LightItalic.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-LightItalic.svg#Roboto) format("svg"); + src: local("Roboto Light Italic"), local("Roboto-LightItalic"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-LightItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-LightItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-LightItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-LightItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-LightItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-LightItalic-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; - src: local("Roboto Italic"), local("Roboto-Italic"), url(../fonts/Roboto/Roboto-Italic.woff2) format("woff2"), url(../fonts/Roboto/Roboto-Italic.woff) format("woff"), url(../fonts/Roboto/Roboto-Italic.ttf) format("truetype"), url(../fonts/Roboto/Roboto-Italic.eot), url(../fonts/Roboto/Roboto-Italic.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-Italic.svg#Roboto) format("svg"); + src: local("Roboto Italic"), local("Roboto-Italic"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Italic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Italic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Italic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Italic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Italic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Italic-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: italic; font-weight: 500; - src: local("Roboto Medium Italic"), local("Roboto-MediumItalic"), url(../fonts/Roboto/Roboto-MediumItalic.woff2) format("woff2"), url(../fonts/Roboto/Roboto-MediumItalic.woff) format("woff"), url(../fonts/Roboto/Roboto-MediumItalic.ttf) format("truetype"), url(../fonts/Roboto/Roboto-MediumItalic.eot), url(../fonts/Roboto/Roboto-MediumItalic.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-MediumItalic.svg#Roboto) format("svg"); + src: local("Roboto Medium Italic"), local("Roboto-MediumItalic"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-MediumItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-MediumItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-MediumItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-MediumItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-MediumItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-MediumItalic-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: italic; font-weight: 700; - src: local("Roboto Bold Italic"), local("Roboto-BoldItalic"), url(../fonts/Roboto/Roboto-BoldItalic.woff2) format("woff2"), url(../fonts/Roboto/Roboto-BoldItalic.woff) format("woff"), url(../fonts/Roboto/Roboto-BoldItalic.ttf) format("truetype"), url(../fonts/Roboto/Roboto-BoldItalic.eot), url(../fonts/Roboto/Roboto-BoldItalic.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-BoldItalic.svg#Roboto) format("svg"); + src: local("Roboto Bold Italic"), local("Roboto-BoldItalic"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BoldItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BoldItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BoldItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BoldItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BoldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BoldItalic-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: italic; font-weight: 900; - src: local("Roboto Black Italic"), local("Roboto-BlackItalic"), url(../fonts/Roboto/Roboto-BlackItalic.woff2) format("woff2"), url(../fonts/Roboto/Roboto-BlackItalic.woff) format("woff"), url(../fonts/Roboto/Roboto-BlackItalic.ttf) format("truetype"), url(../fonts/Roboto/Roboto-BlackItalic.eot), url(../fonts/Roboto/Roboto-BlackItalic.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-BlackItalic.svg#Roboto) format("svg"); + src: local("Roboto Black Italic"), local("Roboto-BlackItalic"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BlackItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BlackItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BlackItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BlackItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BlackItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-BlackItalic-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: normal; font-weight: 100; - src: local("Roboto Thin"), local("Roboto-Thin"), url(../fonts/Roboto/Roboto-Thin.woff2) format("woff2"), url(../fonts/Roboto/Roboto-Thin.woff) format("woff"), url(../fonts/Roboto/Roboto-Thin.ttf) format("truetype"), url(../fonts/Roboto/Roboto-Thin.eot), url(../fonts/Roboto/Roboto-Thin.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-Thin.svg#Roboto) format("svg"); + src: local("Roboto Thin"), local("Roboto-Thin"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Thin-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Thin-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Thin-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Thin-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Thin-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Thin-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: normal; font-weight: 300; - src: local("Roboto Light"), local("Roboto-Light"), url(../fonts/Roboto/Roboto-Light.woff2) format("woff2"), url(../fonts/Roboto/Roboto-Light.woff) format("woff"), url(../fonts/Roboto/Roboto-Light.ttf) format("truetype"), url(../fonts/Roboto/Roboto-Light.eot), url(../fonts/Roboto/Roboto-Light.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-Light.svg#Roboto) format("svg"); + src: local("Roboto Light"), local("Roboto-Light"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Light-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Light-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Light-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Light-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Light-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Light-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; - src: local("Roboto Regular"), local("Roboto-Regular"), url(../fonts/Roboto/Roboto-Regular.woff2) format("woff2"), url(../fonts/Roboto/Roboto-Regular.woff) format("woff"), url(../fonts/Roboto/Roboto-Regular.ttf) format("truetype"), url(../fonts/Roboto/Roboto-Regular.eot), url(../fonts/Roboto/Roboto-Regular.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-Regular.svg#Roboto) format("svg"); + src: local("Roboto Regular"), local("Roboto-Regular"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Regular-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Regular-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Regular-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Regular-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Regular-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Regular-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; - src: local("Roboto Medium"), local("Roboto-Medium"), url(../fonts/Roboto/Roboto-Medium.woff2) format("woff2"), url(../fonts/Roboto/Roboto-Medium.woff) format("woff"), url(../fonts/Roboto/Roboto-Medium.ttf) format("truetype"), url(../fonts/Roboto/Roboto-Medium.eot), url(../fonts/Roboto/Roboto-Medium.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-Medium.svg#Roboto) format("svg"); + src: local("Roboto Medium"), local("Roboto-Medium"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Medium-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Medium-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Medium-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Medium-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Medium-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Medium-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; - src: local("Roboto Bold"), local("Roboto-Bold"), url(../fonts/Roboto/Roboto-Bold.woff2) format("woff2"), url(../fonts/Roboto/Roboto-Bold.woff) format("woff"), url(../fonts/Roboto/Roboto-Bold.ttf) format("truetype"), url(../fonts/Roboto/Roboto-Bold.eot), url(../fonts/Roboto/Roboto-Bold.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-Bold.svg#Roboto) format("svg"); + src: local("Roboto Bold"), local("Roboto-Bold"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Bold-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Bold-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Bold-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Bold-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Bold-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Bold-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "Roboto"; font-style: normal; font-weight: 900; - src: local("Roboto Black"), local("Roboto-Black"), url(../fonts/Roboto/Roboto-Black.woff2) format("woff2"), url(../fonts/Roboto/Roboto-Black.woff) format("woff"), url(../fonts/Roboto/Roboto-Black.ttf) format("truetype"), url(../fonts/Roboto/Roboto-Black.eot), url(../fonts/Roboto/Roboto-Black.eot?#iefix) format("embedded-opentype"), url(../fonts/Roboto/Roboto-Black.svg#Roboto) format("svg"); + src: local("Roboto Black"), local("Roboto-Black"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Black-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Black-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Black-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Black-webfont.eot), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Black-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/Roboto/Roboto-Black-webfont.svg#Roboto) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: italic; font-weight: 100; - src: local("OpenSans Light"), local("OpenSans-LightItalic-webfont"), url(../fonts/OpenSans/OpenSans-LightItalic-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-LightItalic-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-LightItalic-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-LightItalic-webfont.eot), url(../fonts/OpenSans/OpenSans-LightItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-LightItalic-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Light"), local("OpenSans-LightItalic-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-LightItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-LightItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-LightItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-LightItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-LightItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-LightItalic-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: italic; font-weight: 300; - src: local("OpenSans Regular"), local("OpenSans-RegularItalic-webfont"), url(../fonts/OpenSans/OpenSans-RegularItalic-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-RegularItalic-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-RegularItalic-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-RegularItalic-webfont.eot), url(../fonts/OpenSans/OpenSans-RegularItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-RegularItalic-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Regular"), local("OpenSans-RegularItalic-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-RegularItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-RegularItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-RegularItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-RegularItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-RegularItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-RegularItalic-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: italic; font-weight: 400; - src: local("OpenSans Semi Bold"), local("OpenSans-SemiboldItalic-webfont"), url(../fonts/OpenSans/OpenSans-SemiboldItalic-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-SemiboldItalic-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-SemiboldItalic-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-SemiboldItalic-webfont.eot), url(../fonts/OpenSans/OpenSans-SemiboldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-SemiboldItalic-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Semi Bold"), local("OpenSans-SemiboldItalic-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-SemiboldItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-SemiboldItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-SemiboldItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-SemiboldItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-SemiboldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-SemiboldItalic-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: italic; font-weight: 500; - src: local("OpenSans Bold"), local("OpenSans-BoldItalic-webfont"), url(../fonts/OpenSans/OpenSans-BoldItalic-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-BoldItalic-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-BoldItalic-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-BoldItalic-webfont.eot), url(../fonts/OpenSans/OpenSans-BoldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-BoldItalic-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Bold"), local("OpenSans-BoldItalic-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-BoldItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-BoldItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-BoldItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-BoldItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-BoldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-BoldItalic-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: italic; font-weight: 700; - src: local("OpenSans Extra Bold"), local("OpenSans-ExtraBoldItalic-webfont"), url(../fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.eot), url(../fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Extra Bold"), local("OpenSans-ExtraBoldItalic-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBoldItalic-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: normal; font-weight: 100; - src: local("OpenSans Light"), local("OpenSans-Light-webfont"), url(../fonts/OpenSans/OpenSans-Light-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-Light-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-Light-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-Light-webfont.eot), url(../fonts/OpenSans/OpenSans-Light-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-Light-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Light"), local("OpenSans-Light-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Light-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Light-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Light-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Light-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Light-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Light-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: normal; font-weight: 300; - src: local("OpenSans Regular"), local("OpenSans-Regular-webfont"), url(../fonts/OpenSans/OpenSans-Regular-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-Regular-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-Regular-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-Regular-webfont.eot), url(../fonts/OpenSans/OpenSans-Regular-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-Regular-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Regular"), local("OpenSans-Regular-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Regular-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Regular-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Regular-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Regular-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Regular-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Regular-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: normal; font-weight: 400; - src: local("OpenSans Semi Bold"), local("OpenSans-Semibold-webfont"), url(../fonts/OpenSans/OpenSans-Semibold-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-Semibold-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-Semibold-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-Semibold-webfont.eot), url(../fonts/OpenSans/OpenSans-Semibold-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-Semibold-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Semi Bold"), local("OpenSans-Semibold-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Semibold-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Semibold-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Semibold-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Semibold-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Semibold-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Semibold-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: normal; font-weight: 500; - src: local("OpenSans Bold"), local("OpenSans-Bold-webfont"), url(../fonts/OpenSans/OpenSans-Bold-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-Bold-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-Bold-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-Bold-webfont.eot), url(../fonts/OpenSans/OpenSans-Bold-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-Bold-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Bold"), local("OpenSans-Bold-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Bold-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Bold-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Bold-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Bold-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Bold-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-Bold-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } @font-face { font-family: "OpenSans"; font-style: normal; font-weight: 700; - src: local("OpenSans Extra Bold"), local("OpenSans-ExtraBold-webfont"), url(../fonts/OpenSans/OpenSans-ExtraBold-webfont.woff2) format("woff2"), url(../fonts/OpenSans/OpenSans-ExtraBold-webfont.woff) format("woff"), url(../fonts/OpenSans/OpenSans-ExtraBold-webfont.ttf) format("truetype"), url(../fonts/OpenSans/OpenSans-ExtraBold-webfont.eot), url(../fonts/OpenSans/OpenSans-ExtraBold-webfont.eot?#iefix) format("embedded-opentype"), url(../fonts/OpenSans/OpenSans-ExtraBold-webfont.svg#OpenSans) format("svg"); + src: local("OpenSans Extra Bold"), local("OpenSans-ExtraBold-webfont"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBold-webfont.woff2) format("woff2"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBold-webfont.woff) format("woff"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBold-webfont.ttf) format("truetype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBold-webfont.eot), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBold-webfont.eot?#iefix) format("embedded-opentype"), url(../lib/theme-wso2_1.0/fonts/OpenSans/OpenSans-ExtraBold-webfont.svg#OpenSans) format("svg"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000; } /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Black-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Black-webfont.woff2 new file mode 100644 index 0000000000..0cbad2b7b7 Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Black-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-BlackItalic-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-BlackItalic-webfont.woff2 new file mode 100644 index 0000000000..8ca7fc14ab Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-BlackItalic-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Bold-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Bold-webfont.woff2 new file mode 100644 index 0000000000..11cde5d04c Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Bold-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-BoldItalic-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-BoldItalic-webfont.woff2 new file mode 100644 index 0000000000..4b22903565 Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-BoldItalic-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Italic-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Italic-webfont.woff2 new file mode 100644 index 0000000000..e3916a54c6 Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Italic-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Light-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Light-webfont.woff2 new file mode 100644 index 0000000000..c34c128065 Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Light-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-LightItalic-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-LightItalic-webfont.woff2 new file mode 100644 index 0000000000..f4cbbf189c Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-LightItalic-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Medium-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Medium-webfont.woff2 new file mode 100644 index 0000000000..5f96609d81 Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Medium-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-MediumItalic-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-MediumItalic-webfont.woff2 new file mode 100644 index 0000000000..39ea5066a7 Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-MediumItalic-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Regular-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Regular-webfont.woff2 new file mode 100644 index 0000000000..120796bb71 Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Regular-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Thin-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Thin-webfont.woff2 new file mode 100644 index 0000000000..0c7c5bcd25 Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-Thin-webfont.woff2 differ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-ThinItalic-webfont.woff2 b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-ThinItalic-webfont.woff2 new file mode 100644 index 0000000000..324590924e Binary files /dev/null and b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/lib/theme-wso2_1.0/fonts/Roboto/Roboto-ThinItalic-webfont.woff2 differ diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/config/Permissions.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/config/Permissions.java index dd20c772af..6733a42e8d 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/config/Permissions.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/config/Permissions.java @@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlType; * <simpleType> * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> * <enumeration value="/permission/device-mgt/user/groups/device_operation"/> - * <enumeration value="/permission/device-mgt/admin/groups"/> + * <enumeration value="/permission/device-mgt/groups"/> * <enumeration value="/permission/device-mgt/user/groups"/> * <enumeration value="/permission/device-mgt/user/groups/device_monitor"/> * </restriction> diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/PolicyManagementDAOFactory.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/PolicyManagementDAOFactory.java index 0b00f90b14..026335ccf7 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/PolicyManagementDAOFactory.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/PolicyManagementDAOFactory.java @@ -20,13 +20,16 @@ package org.wso2.carbon.policy.mgt.core.dao; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; import org.wso2.carbon.device.mgt.common.IllegalTransactionStateException; +import org.wso2.carbon.device.mgt.common.UnsupportedDatabaseEngineException; import org.wso2.carbon.policy.mgt.core.config.datasource.DataSourceConfig; import org.wso2.carbon.policy.mgt.core.config.datasource.JNDILookupDefinition; -import org.wso2.carbon.policy.mgt.core.dao.impl.FeatureDAOImpl; import org.wso2.carbon.policy.mgt.core.dao.impl.MonitoringDAOImpl; import org.wso2.carbon.policy.mgt.core.dao.impl.PolicyDAOImpl; import org.wso2.carbon.policy.mgt.core.dao.impl.ProfileDAOImpl; +import org.wso2.carbon.policy.mgt.core.dao.impl.feature.GenericFeatureDAOImpl; +import org.wso2.carbon.policy.mgt.core.dao.impl.feature.SQLServerFeatureDAOImpl; import org.wso2.carbon.policy.mgt.core.dao.util.PolicyManagementDAOUtil; import javax.sql.DataSource; @@ -38,15 +41,26 @@ import java.util.List; public class PolicyManagementDAOFactory { private static DataSource dataSource; + private static String databaseEngine; private static final Log log = LogFactory.getLog(PolicyManagementDAOFactory.class); private static ThreadLocal currentConnection = new ThreadLocal<>(); public static void init(DataSourceConfig config) { dataSource = resolveDataSource(config); + try { + databaseEngine = dataSource.getConnection().getMetaData().getDatabaseProductName(); + } catch (SQLException e) { + log.error("Error occurred while retrieving config.datasource connection", e); + } } public static void init(DataSource dtSource) { dataSource = dtSource; + try { + databaseEngine = dataSource.getConnection().getMetaData().getDatabaseProductName(); + } catch (SQLException e) { + log.error("Error occurred while retrieving config.datasource connection", e); + } } public static PolicyDAO getPolicyDAO() { @@ -58,7 +72,20 @@ public class PolicyManagementDAOFactory { } public static FeatureDAO getFeatureDAO() { - return new FeatureDAOImpl(); + if (databaseEngine != null) { + switch (databaseEngine) { + case DeviceManagementConstants.DataBaseTypes.DB_TYPE_MSSQL: + return new SQLServerFeatureDAOImpl(); + case DeviceManagementConstants.DataBaseTypes.DB_TYPE_ORACLE: + case DeviceManagementConstants.DataBaseTypes.DB_TYPE_POSTGRESQL: + case DeviceManagementConstants.DataBaseTypes.DB_TYPE_H2: + case DeviceManagementConstants.DataBaseTypes.DB_TYPE_MYSQL: + return new GenericFeatureDAOImpl(); + default: + throw new UnsupportedDatabaseEngineException("Unsupported database engine : " + databaseEngine); + } + } + throw new IllegalStateException("Database engine has not initialized properly."); } public static MonitoringDAO getMonitoringDAO() { diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/FeatureDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/feature/AbstractFeatureDAO.java similarity index 79% rename from components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/FeatureDAOImpl.java rename to components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/feature/AbstractFeatureDAO.java index 80e56af140..c94cf48b2a 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/FeatureDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/feature/AbstractFeatureDAO.java @@ -1,22 +1,22 @@ /* -* Copyright (c) 2015 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* WSO2 Inc. licenses this file to you under the Apache License, -* Version 2.0 (the "License"); you may not use this file except -* in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -package org.wso2.carbon.policy.mgt.core.dao.impl; + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * you may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.policy.mgt.core.dao.impl.feature; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -40,9 +40,12 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; -public class FeatureDAOImpl implements FeatureDAO { +/** + * Abstract implementation of FeatureDAO which holds generic SQL queries. + */ +public abstract class AbstractFeatureDAO implements FeatureDAO { - private static final Log log = LogFactory.getLog(FeatureDAOImpl.class); + private static final Log log = LogFactory.getLog(AbstractFeatureDAO.class); @Override public ProfileFeature addProfileFeature(ProfileFeature feature, int profileId) throws FeatureManagerDAOException { @@ -51,59 +54,13 @@ public class FeatureDAOImpl implements FeatureDAO { @Override public ProfileFeature updateProfileFeature(ProfileFeature feature, int profileId) throws - FeatureManagerDAOException { + FeatureManagerDAOException { return null; } - @Override - public List addProfileFeatures(List features, int profileId) throws - FeatureManagerDAOException { - - Connection conn; - PreparedStatement stmt = null; - ResultSet generatedKeys = null; - int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); - - try { - conn = this.getConnection(); - String query = "INSERT INTO DM_PROFILE_FEATURES (PROFILE_ID, FEATURE_CODE, DEVICE_TYPE, CONTENT, " + - "TENANT_ID) VALUES (?, ?, ?, ?, ?)"; - stmt = conn.prepareStatement(query, new String[] {"id"}); - - for (ProfileFeature feature : features) { - stmt.setInt(1, profileId); - stmt.setString(2, feature.getFeatureCode()); - stmt.setString(3, feature.getDeviceType()); - // if (conn.getMetaData().getDriverName().contains("H2")) { - // stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent())); - // } else { - stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent())); - //} - stmt.setInt(5, tenantId); - stmt.addBatch(); - //Not adding the logic to check the size of the stmt and execute if the size records added is over 1000 - } - stmt.executeBatch(); - - generatedKeys = stmt.getGeneratedKeys(); - int i = 0; - - while (generatedKeys.next()) { - features.get(i).setId(generatedKeys.getInt(1)); - i++; - } - - } catch (SQLException | IOException e) { - throw new FeatureManagerDAOException("Error occurred while adding the feature list to the database.", e); - } finally { - PolicyManagementDAOUtil.cleanupResources(stmt, generatedKeys); - } - return features; - } - @Override public List updateProfileFeatures(List features, int profileId) throws - FeatureManagerDAOException { + FeatureManagerDAOException { Connection conn; PreparedStatement stmt = null; @@ -112,7 +69,7 @@ public class FeatureDAOImpl implements FeatureDAO { try { conn = this.getConnection(); String query = "UPDATE DM_PROFILE_FEATURES SET CONTENT = ? WHERE PROFILE_ID = ? AND FEATURE_CODE = ? AND" + - " TENANT_ID = ?"; + " TENANT_ID = ?"; stmt = conn.prepareStatement(query); for (ProfileFeature feature : features) { @@ -209,7 +166,7 @@ public class FeatureDAOImpl implements FeatureDAO { try { conn = this.getConnection(); String query = "SELECT ID, PROFILE_ID, FEATURE_CODE, DEVICE_TYPE, CONTENT FROM DM_PROFILE_FEATURES " + - "WHERE TENANT_ID = ?"; + "WHERE TENANT_ID = ?"; stmt = conn.prepareStatement(query); stmt.setInt(1, tenantId); resultSet = stmt.executeQuery(); @@ -270,8 +227,8 @@ public class FeatureDAOImpl implements FeatureDAO { try { conn = this.getConnection(); String query = "SELECT f.ID ID, f.NAME NAME, f.CODE CODE, f.DEVICE_TYPE DEVICE_TYPE," + - " f.EVALUATION_RULE EVALUATION_RULE FROM DM_FEATURES f INNER JOIN DM_DEVICE_TYPE d " + - "ON d.ID=f.DEVICE_TYPE WHERE d.NAME = ?"; + " f.EVALUATION_RULE EVALUATION_RULE FROM DM_FEATURES f INNER JOIN DM_DEVICE_TYPE d " + + "ON d.ID=f.DEVICE_TYPE WHERE d.NAME = ?"; stmt = conn.prepareStatement(query); stmt.setString(1, deviceType); resultSet = stmt.executeQuery(); @@ -286,7 +243,7 @@ public class FeatureDAOImpl implements FeatureDAO { } } catch (SQLException e) { throw new FeatureManagerDAOException("Unable to get the list of the features related device type " + - "from database.", e); + "from database.", e); } finally { PolicyManagementDAOUtil.cleanupResources(stmt, resultSet); } @@ -304,7 +261,7 @@ public class FeatureDAOImpl implements FeatureDAO { try { conn = this.getConnection(); String query = "SELECT ID, FEATURE_CODE, DEVICE_TYPE, CONTENT FROM DM_PROFILE_FEATURES " + - "WHERE PROFILE_ID = ? AND TENANT_ID = ?"; + "WHERE PROFILE_ID = ? AND TENANT_ID = ?"; stmt = conn.prepareStatement(query); stmt.setInt(1, profileId); stmt.setInt(2, tenantId); @@ -372,7 +329,7 @@ public class FeatureDAOImpl implements FeatureDAO { return false; } catch (SQLException e) { throw new FeatureManagerDAOException("Unable to delete the feature " + featureId + " (Feature ID) " + - "from database.", e); + "from database.", e); } finally { PolicyManagementDAOUtil.cleanupResources(stmt, null); } @@ -381,5 +338,4 @@ public class FeatureDAOImpl implements FeatureDAO { private Connection getConnection() throws FeatureManagerDAOException { return PolicyManagementDAOFactory.getConnection(); } - } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/feature/GenericFeatureDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/feature/GenericFeatureDAOImpl.java new file mode 100644 index 0000000000..520e5da8a1 --- /dev/null +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/feature/GenericFeatureDAOImpl.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * you may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.policy.mgt.core.dao.impl.feature; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.policy.mgt.common.ProfileFeature; +import org.wso2.carbon.policy.mgt.core.dao.FeatureManagerDAOException; +import org.wso2.carbon.policy.mgt.core.dao.PolicyManagementDAOFactory; +import org.wso2.carbon.policy.mgt.core.dao.util.PolicyManagementDAOUtil; +import org.wso2.carbon.policy.mgt.core.util.PolicyManagerUtil; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +/** + * FeatureDAO implementation for DB engines with ANSI SQL support. + */ +public final class GenericFeatureDAOImpl extends AbstractFeatureDAO { + + private static final Log log = LogFactory.getLog(GenericFeatureDAOImpl.class); + + @Override + public List addProfileFeatures(List features, int profileId) throws + FeatureManagerDAOException { + + Connection conn; + PreparedStatement stmt = null; + ResultSet generatedKeys = null; + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); + + try { + conn = this.getConnection(); + String query = "INSERT INTO DM_PROFILE_FEATURES (PROFILE_ID, FEATURE_CODE, DEVICE_TYPE, CONTENT, " + + "TENANT_ID) VALUES (?, ?, ?, ?, ?)"; + stmt = conn.prepareStatement(query, new String[] {"id"}); + + for (ProfileFeature feature : features) { + stmt.setInt(1, profileId); + stmt.setString(2, feature.getFeatureCode()); + stmt.setString(3, feature.getDeviceType()); + // if (conn.getMetaData().getDriverName().contains("H2")) { + // stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent())); + // } else { + stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent())); + //} + stmt.setInt(5, tenantId); + stmt.addBatch(); + //Not adding the logic to check the size of the stmt and execute if the size records added is over 1000 + } + stmt.executeBatch(); + + generatedKeys = stmt.getGeneratedKeys(); + int i = 0; + + while (generatedKeys.next()) { + features.get(i).setId(generatedKeys.getInt(1)); + i++; + } + + } catch (SQLException | IOException e) { + throw new FeatureManagerDAOException("Error occurred while adding the feature list to the database.", e); + } finally { + PolicyManagementDAOUtil.cleanupResources(stmt, generatedKeys); + } + return features; + } + + private Connection getConnection() throws FeatureManagerDAOException { + return PolicyManagementDAOFactory.getConnection(); + } +} \ No newline at end of file diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/feature/SQLServerFeatureDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/feature/SQLServerFeatureDAOImpl.java new file mode 100644 index 0000000000..ea5c538003 --- /dev/null +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/feature/SQLServerFeatureDAOImpl.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * you may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.policy.mgt.core.dao.impl.feature; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.policy.mgt.common.ProfileFeature; +import org.wso2.carbon.policy.mgt.core.dao.FeatureManagerDAOException; +import org.wso2.carbon.policy.mgt.core.dao.PolicyManagementDAOFactory; +import org.wso2.carbon.policy.mgt.core.dao.util.PolicyManagementDAOUtil; +import org.wso2.carbon.policy.mgt.core.util.PolicyManagerUtil; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +/** + * FeatureDAO implementation for MSSQL DB engine. + */ +public final class SQLServerFeatureDAOImpl extends AbstractFeatureDAO { + + private static final Log log = LogFactory.getLog(SQLServerFeatureDAOImpl.class); + + @Override + public List addProfileFeatures(List features, int profileId) throws + FeatureManagerDAOException { + + Connection conn; + PreparedStatement stmt = null; + ResultSet generatedKeys = null; + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); + + try { + conn = this.getConnection(); + String query = "INSERT INTO DM_PROFILE_FEATURES (PROFILE_ID, FEATURE_CODE, DEVICE_TYPE, CONTENT, " + + "TENANT_ID) VALUES (?, ?, ?, ?, ?)"; + stmt = conn.prepareStatement(query, new String[] {"id"}); + + for (ProfileFeature feature : features) { + stmt.setInt(1, profileId); + stmt.setString(2, feature.getFeatureCode()); + stmt.setString(3, feature.getDeviceType()); + // if (conn.getMetaData().getDriverName().contains("H2")) { + // stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent())); + // } else { + stmt.setBytes(4, PolicyManagerUtil.getBytes(feature.getContent())); + //} + stmt.setInt(5, tenantId); + stmt.addBatch(); + //Not adding the logic to check the size of the stmt and execute if the size records added is over 1000 + } + stmt.executeBatch(); +// This logic has been commented out due to getGeneratedKeys method is not supported in MSSQL. +// generatedKeys = stmt.getGeneratedKeys(); +// int i = 0; +// +// while (generatedKeys.next()) { +// features.get(i).setId(generatedKeys.getInt(1)); +// i++; +// } + + } catch (SQLException | IOException e) { + throw new FeatureManagerDAOException("Error occurred while adding the feature list to the database.", e); + } finally { + PolicyManagementDAOUtil.cleanupResources(stmt, generatedKeys); + } + return features; + } + + private Connection getConnection() throws FeatureManagerDAOException { + return PolicyManagementDAOFactory.getConnection(); + } + +}