This is an automated email from the ASF dual-hosted git repository.

mdisabatino pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/2_1_X by this push:
     new 093c066  [SYNCOPE-1547] customize the roles to be displayed
093c066 is described below

commit 093c066956ed1867a593e997dba5752cf99a1d2e
Author: Marco Di Sabatino Di Diodoro <[email protected]>
AuthorDate: Wed Mar 11 17:02:33 2020 +0100

    [SYNCOPE-1547] customize the roles to be displayed
---
 .../apache/syncope/client/console/wizards/any/Roles.java   | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Roles.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Roles.java
index 96fde86..ffc28b8 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Roles.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Roles.java
@@ -49,7 +49,7 @@ public class Roles extends WizardStep implements ICondition {
     private final List<String> allRoles;
 
     protected WebMarkupContainer dynrolesContainer;
-
+    
     public <T extends AnyTO> Roles(final AnyWrapper<?> modelObject) {
         if (!(modelObject.getInnerObject() instanceof UserTO)) {
             throw new IllegalStateException("Invalid instance " + 
modelObject.getInnerObject());
@@ -77,10 +77,7 @@ public class Roles extends WizardStep implements ICondition {
 
         this.setOutputMarkupId(true);
 
-        allRoles = 
SyncopeConsoleApplication.get().getSecuritySettings().getAuthorizationStrategy().
-                isActionAuthorized(this, RENDER)
-                ? new 
RoleRestClient().list().stream().map(RoleTO::getKey).sorted().collect(Collectors.toList())
-                : Collections.<String>emptyList();
+        allRoles = getManagedRoles();
 
         add(new AjaxPalettePanel.Builder<String>().
                 withFilter().
@@ -123,4 +120,11 @@ public class Roles extends WizardStep implements 
ICondition {
                 && 
SyncopeConsoleApplication.get().getSecuritySettings().getAuthorizationStrategy().
                         isActionAuthorized(this, RENDER);
     }
+        
+    protected List<String> getManagedRoles() {
+        return 
SyncopeConsoleApplication.get().getSecuritySettings().getAuthorizationStrategy().
+                isActionAuthorized(this, RENDER)
+                ? new 
RoleRestClient().list().stream().map(RoleTO::getKey).sorted().collect(Collectors.toList())
+                : Collections.<String>emptyList();
+    }
 }

Reply via email to