From c909144589897b868f7bec601b873d83abf99315 Mon Sep 17 00:00:00 2001 From: charitha Date: Mon, 9 Jan 2017 15:02:10 +0530 Subject: [PATCH 1/5] Add select2 controller to select roles to share a group --- .../app/pages/cdmf.page.groups/groups.hbs | 21 +++++++++-- .../cdmf.page.groups/public/js/listing.js | 37 +++++-------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs index da79afe1bd1..198890e4ba2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs @@ -119,10 +119,9 @@

Select user role(s) -

-
-

+
+
'; - $('.roleCheckBoxes').each( - function () { - if (data.roles[i] == $(this).data('role-name')) { - $(this).attr('checked', true); - } - } - ); + html += ''; } + html += ''; $("#rolesListing").html(html); markAlreadySavedUsersRoles(groupId); + $("select.select2[multiple=multiple]").select2({ + tags: false + }); } else { $("#rolesListing").html("No roles available"); } From 9d5061230c87b5be023e3963776cd64e4f0e45e2 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 10 Jan 2017 09:27:10 +0530 Subject: [PATCH 2/5] fixing test failures (cherry picked from commit ac8dae7) --- .../src/test/resources/testng.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml index b30b66cb78c..32c9dca57de 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml @@ -31,7 +31,7 @@ - + From 819074833f88520a245db67f57d38eb846771ac8 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 10 Jan 2017 03:09:42 +0530 Subject: [PATCH 3/5] added missing components (cherry picked from commit b35e0dd) --- .../pom.xml | 7 +++++++ .../device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml | 5 +++++ pom.xml | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml index 0cc36fe99e7..8c8d0665d6d 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml @@ -48,6 +48,10 @@ org.wso2.orbit.org.scannotation scannotation + + io.swagger + swagger-annotations + @@ -137,6 +141,9 @@ org.wso2.orbit.org.scannotation:scannotation:${scannotation.version} + + io.swagger:swagger-annotations:${swagger.version} + org.wso2.carbon.core.server:${carbon.kernel.version} diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml index 3ba32fa1bc3..ee5fa7b255a 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml @@ -48,6 +48,10 @@ javax.servlet.jsp javax.servlet.jsp-api + + org.wso2.carbon.store + org.wso2.store.sso.common + @@ -76,6 +80,7 @@ javax.servlet.jsp:javax.servlet.jsp-api + org.wso2.carbon.store:org.wso2.store.sso.common:${carbon.store.sso.common.version} diff --git a/pom.xml b/pom.xml index e9339f6644a..76fb99e3b2d 100644 --- a/pom.xml +++ b/pom.xml @@ -1664,6 +1664,11 @@ wss4j ${org.apache.ws.security.wso2.version} + + org.wso2.carbon.store + org.wso2.store.sso.common + ${carbon.store.sso.common.version} + @@ -2059,6 +2064,9 @@ 2.1.7-wso2v7 1.5.11.wso2v15 + + + 1.4.4 From cb7ff7f66a1200472a4dc3b72d49a73220724352 Mon Sep 17 00:00:00 2001 From: charitha Date: Tue, 10 Jan 2017 10:18:28 +0530 Subject: [PATCH 4/5] Change package name to lower case --- .../device/mgt/core/{Search => search}/DeviceDetails.java | 0 .../carbon/device/mgt/core/{Search => search}/SearchDevice.java | 0 .../carbon/device/mgt/core/{Search => search}/util/Utils.java | 0 .../src/test/resources/testng.xml | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/{Search => search}/DeviceDetails.java (100%) rename components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/{Search => search}/SearchDevice.java (100%) rename components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/{Search => search}/util/Utils.java (100%) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/DeviceDetails.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/DeviceDetails.java similarity index 100% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/DeviceDetails.java rename to components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/DeviceDetails.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/SearchDevice.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/SearchDevice.java similarity index 100% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/SearchDevice.java rename to components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/SearchDevice.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/util/Utils.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/util/Utils.java similarity index 100% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/Search/util/Utils.java rename to components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/search/util/Utils.java diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml index 32c9dca57de..b30b66cb78c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/testng.xml @@ -31,7 +31,7 @@ - + From 562631cc1d639c8d923866fb4dd0196c60845507 Mon Sep 17 00:00:00 2001 From: Milan Perera Date: Tue, 10 Jan 2017 11:36:45 +0530 Subject: [PATCH 5/5] Fixed scopes related issue in SAML Granttype --- .../devicemgt/app/modules/oauth/token-handlers.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js index d9d51101c19..1365fed2673 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js @@ -90,9 +90,15 @@ var handlers = function () { "missing - setupTokenPairByPasswordGrantType(x, y)"); } else { var tokenData; + var arrayOfScopes = devicemgtProps["scopes"]; + var stringOfScopes = ""; + arrayOfScopes.forEach(function (entry) { + stringOfScopes += entry + " "; + }); + // accessTokenPair will include current access token as well as current refresh token tokenData = tokenUtil. - getTokenPairAndScopesBySAMLGrantType(samlToken, encodedClientAppCredentials, "PRODUCTION"); + getTokenPairAndScopesBySAMLGrantType(samlToken, encodedClientAppCredentials, stringOfScopes); if (!tokenData) { throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up token " + "pair by password grant type. Error in token " +