[3/3] syncope git commit: [SYNCOPE-1360] Reworking DynRealms-based delegated administration from Admin Console
[SYNCOPE-1360] Reworking DynRealms-based delegated administration from Admin Console Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/b9a5c5d1 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/b9a5c5d1 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/b9a5c5d1 Branch: refs/heads/2_0_X Commit: b9a5c5d1ebc97d7f78afba8befda3c4c5fbe6f82 Parents: 865bd70 Author: Francesco Chicchiriccò Authored: Mon Sep 3 17:28:05 2018 +0200 Committer: Francesco Chicchiriccò Committed: Mon Sep 3 17:31:20 2018 +0200 -- .../client/console/SyncopeConsoleSession.java | 45 ++-- .../console/panels/AnyDirectoryPanel.java | 13 +- .../console/panels/AnyObjectDirectoryPanel.java | 4 +- .../syncope/client/console/panels/AnyPanel.java | 6 +-- .../console/panels/GroupDirectoryPanel.java | 9 ++-- .../console/panels/UserDirectoryPanel.java | 17 +--- .../console/wicket/markup/html/form/Action.java | 24 --- .../wicket/markup/html/form/ActionPanel.java| 2 +- .../java/data/UserDataBinderImpl.java | 6 +-- .../reference-guide/concepts/roles.adoc | 1 + 10 files changed, 87 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/b9a5c5d1/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java -- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java index aa8a28c..bda14db 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java @@ -20,8 +20,10 @@ package org.apache.syncope.client.console; import java.text.DateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -33,6 +35,7 @@ import javax.ws.rs.core.MediaType; import org.apache.commons.collections4.IterableUtils; import org.apache.commons.collections4.Predicate; import org.apache.commons.collections4.list.SetUniqueList; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.lang3.tuple.Pair; @@ -213,25 +216,39 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession { return sortable; } -public boolean owns(final String entitlements) { -return owns(entitlements, SyncopeConstants.ROOT_REALM); -} - -public boolean owns(final String entitlements, final String realm) { +public boolean owns(final String entitlements, final String... realms) { if (StringUtils.isEmpty(entitlements)) { return true; } +if (auth == null) { +return false; +} + +Set requested = ArrayUtils.isEmpty(realms) +? Collections.singleton(SyncopeConstants.ROOT_REALM) +: new HashSet<>(Arrays.asList(realms)); + for (String entitlement : entitlements.split(",")) { -if (auth != null && auth.containsKey(entitlement) -&& (realm == null || IterableUtils.matchesAny(auth.get(entitlement), new Predicate() { - -@Override -public boolean evaluate(final String ownedRealm) { -return realm.startsWith(ownedRealm); -} -}))) { -return true; +if (auth.containsKey(entitlement)) { +boolean owns = false; + +Set owned = auth.get(entitlement); +for (final String realm : requested) { +if (realm.startsWith(SyncopeConstants.ROOT_REALM)) { +owns |= IterableUtils.matchesAny(owned, new Predicate() { + +@Override +public boolean evaluate(final String ownedRealm) { +return realm.startsWith(ownedRealm); +} +}); +} else { +owns |= owned.contains(realm); +} +} + +return owns; } } http://git-wip-us.apache.org/repos/asf/syncope/blob/b9a5c5d1/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java
[1/3] syncope git commit: [SYNCOPE-1360] Reworking DynRealms-based delegated administration from Admin Console
Repository: syncope Updated Branches: refs/heads/2_0_X 865bd7017 -> b9a5c5d1e refs/heads/2_1_X 484dd1a46 -> 37539b4de refs/heads/master d7f034ada -> 4fec32be0 [SYNCOPE-1360] Reworking DynRealms-based delegated administration from Admin Console Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/37539b4d Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/37539b4d Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/37539b4d Branch: refs/heads/2_1_X Commit: 37539b4dee039af19e60ad5694b57bfcdf56b207 Parents: 484dd1a Author: Francesco Chicchiriccò Authored: Mon Sep 3 17:28:05 2018 +0200 Committer: Francesco Chicchiriccò Committed: Mon Sep 3 17:28:05 2018 +0200 -- .../client/console/SyncopeConsoleSession.java | 33 +++- .../console/panels/AnyDirectoryPanel.java | 13 +++- .../console/panels/AnyObjectDirectoryPanel.java | 4 +-- .../syncope/client/console/panels/AnyPanel.java | 6 ++-- .../console/panels/GroupDirectoryPanel.java | 9 +++--- .../console/panels/UserDirectoryPanel.java | 16 ++ .../console/wicket/markup/html/form/Action.java | 24 +++--- .../wicket/markup/html/form/ActionPanel.java| 2 +- .../java/data/UserDataBinderImpl.java | 6 ++-- .../reference-guide/concepts/roles.adoc | 1 + 10 files changed, 81 insertions(+), 33 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/37539b4d/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java -- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java index bfde815..2f952ee 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java @@ -20,8 +20,10 @@ package org.apache.syncope.client.console; import java.text.DateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -32,6 +34,7 @@ import java.util.concurrent.Future; import javax.ws.rs.core.EntityTag; import javax.ws.rs.core.MediaType; import org.apache.commons.collections4.list.SetUniqueList; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.lang3.tuple.Pair; @@ -224,19 +227,33 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession { return sortable; } -public boolean owns(final String entitlements) { -return owns(entitlements, SyncopeConstants.ROOT_REALM); -} - -public boolean owns(final String entitlements, final String realm) { +public boolean owns(final String entitlements, final String... realms) { if (StringUtils.isEmpty(entitlements)) { return true; } +if (auth == null) { +return false; +} + +Set requested = ArrayUtils.isEmpty(realms) +? Collections.singleton(SyncopeConstants.ROOT_REALM) +: new HashSet<>(Arrays.asList(realms)); + for (String entitlement : entitlements.split(",")) { -if (auth != null && auth.containsKey(entitlement) && (realm == null -|| auth.get(entitlement).stream().anyMatch(ownedRealm -> realm.startsWith(ownedRealm { -return true; +if (auth.containsKey(entitlement)) { +boolean owns = false; + +Set owned = auth.get(entitlement); +for (String realm : requested) { +if (realm.startsWith(SyncopeConstants.ROOT_REALM)) { +owns |= owned.stream().anyMatch(ownedRealm -> realm.startsWith(ownedRealm)); +} else { +owns |= owned.contains(realm); +} +} + +return owns; } } http://git-wip-us.apache.org/repos/asf/syncope/blob/37539b4d/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java -- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java index 8fdc994..ec8a995 100644 ---
[2/3] syncope git commit: [SYNCOPE-1360] Reworking DynRealms-based delegated administration from Admin Console
[SYNCOPE-1360] Reworking DynRealms-based delegated administration from Admin Console Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/4fec32be Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/4fec32be Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/4fec32be Branch: refs/heads/master Commit: 4fec32be0708252585f4cbfbc9dd25b5670d37ff Parents: d7f034a Author: Francesco Chicchiriccò Authored: Mon Sep 3 17:28:05 2018 +0200 Committer: Francesco Chicchiriccò Committed: Mon Sep 3 17:28:14 2018 +0200 -- .../client/console/SyncopeConsoleSession.java | 33 +++- .../console/panels/AnyDirectoryPanel.java | 13 +++- .../console/panels/AnyObjectDirectoryPanel.java | 4 +-- .../syncope/client/console/panels/AnyPanel.java | 6 ++-- .../console/panels/GroupDirectoryPanel.java | 9 +++--- .../console/panels/UserDirectoryPanel.java | 16 ++ .../console/wicket/markup/html/form/Action.java | 24 +++--- .../wicket/markup/html/form/ActionPanel.java| 2 +- .../java/data/UserDataBinderImpl.java | 6 ++-- .../reference-guide/concepts/roles.adoc | 1 + 10 files changed, 81 insertions(+), 33 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/4fec32be/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java -- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java index bfde815..2f952ee 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java @@ -20,8 +20,10 @@ package org.apache.syncope.client.console; import java.text.DateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -32,6 +34,7 @@ import java.util.concurrent.Future; import javax.ws.rs.core.EntityTag; import javax.ws.rs.core.MediaType; import org.apache.commons.collections4.list.SetUniqueList; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.lang3.tuple.Pair; @@ -224,19 +227,33 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession { return sortable; } -public boolean owns(final String entitlements) { -return owns(entitlements, SyncopeConstants.ROOT_REALM); -} - -public boolean owns(final String entitlements, final String realm) { +public boolean owns(final String entitlements, final String... realms) { if (StringUtils.isEmpty(entitlements)) { return true; } +if (auth == null) { +return false; +} + +Set requested = ArrayUtils.isEmpty(realms) +? Collections.singleton(SyncopeConstants.ROOT_REALM) +: new HashSet<>(Arrays.asList(realms)); + for (String entitlement : entitlements.split(",")) { -if (auth != null && auth.containsKey(entitlement) && (realm == null -|| auth.get(entitlement).stream().anyMatch(ownedRealm -> realm.startsWith(ownedRealm { -return true; +if (auth.containsKey(entitlement)) { +boolean owns = false; + +Set owned = auth.get(entitlement); +for (String realm : requested) { +if (realm.startsWith(SyncopeConstants.ROOT_REALM)) { +owns |= owned.stream().anyMatch(ownedRealm -> realm.startsWith(ownedRealm)); +} else { +owns |= owned.contains(realm); +} +} + +return owns; } } http://git-wip-us.apache.org/repos/asf/syncope/blob/4fec32be/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java -- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java index 8fdc994..ec8a995 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnyDirectoryPanel.java @@
[2/3] syncope git commit: Upgrading Swagger UI and GreenMail
Upgrading Swagger UI and GreenMail Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/484dd1a4 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/484dd1a4 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/484dd1a4 Branch: refs/heads/2_1_X Commit: 484dd1a4633aa902c46cef676f69bbe5e934e35c Parents: a3d0345 Author: Francesco Chicchiriccò Authored: Mon Sep 3 12:42:55 2018 +0200 Committer: Francesco Chicchiriccò Committed: Mon Sep 3 12:46:36 2018 +0200 -- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/484dd1a4/pom.xml -- diff --git a/pom.xml b/pom.xml index aa07ba3..5696b7b 100644 --- a/pom.xml +++ b/pom.xml @@ -442,7 +442,7 @@ under the License. ${project.build.directory}/flowable-modeler 2.0.3 -3.18.1 +3.18.2 20.0 2.2.4 @@ -1655,7 +1655,7 @@ under the License. com.icegreen greenmail -1.5.7 +1.5.8 test
[1/3] syncope git commit: Upgrading Swagger UI and GreenMail
Repository: syncope Updated Branches: refs/heads/2_0_X 02eb5fdce -> 865bd7017 refs/heads/2_1_X a3d0345f6 -> 484dd1a46 refs/heads/master 6ad136fa6 -> d7f034ada Upgrading Swagger UI and GreenMail Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/865bd701 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/865bd701 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/865bd701 Branch: refs/heads/2_0_X Commit: 865bd701720bcf93a4f3739892c02fe40691fce6 Parents: 02eb5fd Author: Francesco Chicchiriccò Authored: Mon Sep 3 12:42:55 2018 +0200 Committer: Francesco Chicchiriccò Committed: Mon Sep 3 12:42:55 2018 +0200 -- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/865bd701/pom.xml -- diff --git a/pom.xml b/pom.xml index 961d646..c2eb7d8 100644 --- a/pom.xml +++ b/pom.xml @@ -446,7 +446,7 @@ under the License. ${project.build.directory}/flowable-modeler 1.5.17 -3.18.1 +3.18.2 20.0 2.2.4 @@ -1757,7 +1757,7 @@ under the License. com.icegreen greenmail -1.5.7 +1.5.8 test
[3/3] syncope git commit: Upgrading Swagger UI and GreenMail
Upgrading Swagger UI and GreenMail Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/d7f034ad Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/d7f034ad Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/d7f034ad Branch: refs/heads/master Commit: d7f034adaaa3a76028ffc00454f2496f27fdbe3b Parents: 6ad136f Author: Francesco Chicchiriccò Authored: Mon Sep 3 12:42:55 2018 +0200 Committer: Francesco Chicchiriccò Committed: Mon Sep 3 12:46:50 2018 +0200 -- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/d7f034ad/pom.xml -- diff --git a/pom.xml b/pom.xml index ff22dd2..da318f4 100644 --- a/pom.xml +++ b/pom.xml @@ -442,7 +442,7 @@ under the License. ${project.build.directory}/flowable-modeler 2.0.3 -3.18.1 +3.18.2 20.0 2.2.4 @@ -1655,7 +1655,7 @@ under the License. com.icegreen greenmail -1.5.7 +1.5.8 test
syncope git commit: AD bundle version upgrade
Repository: syncope Updated Branches: refs/heads/2_1_X 87e1562ab -> a3d0345f6 AD bundle version upgrade Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/a3d0345f Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/a3d0345f Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/a3d0345f Branch: refs/heads/2_1_X Commit: a3d0345f692ccaaa782fdad4cb995a7bfa214c3b Parents: 87e1562 Author: fmartelli Authored: Mon Sep 3 12:18:35 2018 +0200 Committer: fmartelli Committed: Mon Sep 3 12:18:35 2018 +0200 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/a3d0345f/pom.xml -- diff --git a/pom.xml b/pom.xml index 3209c32..aa07ba3 100644 --- a/pom.xml +++ b/pom.xml @@ -383,7 +383,7 @@ under the License. 2.2.5 0.8.7 1.5.2 -1.3.4 +1.3.5 1.4.1 1.0.1 1.0.1
syncope git commit: AD bundle version upgrade
Repository: syncope Updated Branches: refs/heads/2_0_X 65a373151 -> 02eb5fdce AD bundle version upgrade Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/02eb5fdc Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/02eb5fdc Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/02eb5fdc Branch: refs/heads/2_0_X Commit: 02eb5fdce8c90bbb3453669b621cf96a7cfffd5b Parents: 65a3731 Author: fmartelli Authored: Mon Sep 3 12:17:49 2018 +0200 Committer: fmartelli Committed: Mon Sep 3 12:17:49 2018 +0200 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/02eb5fdc/pom.xml -- diff --git a/pom.xml b/pom.xml index 831c0a5..961d646 100644 --- a/pom.xml +++ b/pom.xml @@ -383,7 +383,7 @@ under the License. 2.2.5 0.8.7 1.5.2 -1.3.4 +1.3.5 1.4.1 1.0.1 1.0.1
syncope git commit: AD bundle version upgrade
Repository: syncope Updated Branches: refs/heads/master 78bd84649 -> 6ad136fa6 AD bundle version upgrade Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/6ad136fa Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/6ad136fa Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/6ad136fa Branch: refs/heads/master Commit: 6ad136fa611b59d292a8b05bda8aeb516781f85b Parents: 78bd846 Author: fmartelli Authored: Mon Sep 3 12:18:58 2018 +0200 Committer: fmartelli Committed: Mon Sep 3 12:18:58 2018 +0200 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/6ad136fa/pom.xml -- diff --git a/pom.xml b/pom.xml index b2de123..ff22dd2 100644 --- a/pom.xml +++ b/pom.xml @@ -383,7 +383,7 @@ under the License. 2.2.5 0.8.7 1.5.2 -1.3.4 +1.3.5 1.4.1 1.0.1 1.0.1