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 4c9e45a  [SYNCOPE-1547] customize the roles to be displayed
4c9e45a is described below

commit 4c9e45aee7d076262cd6ec4a10415b5f2e33c90e
Author: Marco Di Sabatino Di Diodoro <[email protected]>
AuthorDate: Thu Mar 12 14:24:05 2020 +0100

    [SYNCOPE-1547] customize the roles to be displayed
---
 .../apache/syncope/client/console/wizards/any/Roles.java   | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 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 ffc28b8..de99593 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
@@ -48,8 +48,10 @@ public class Roles extends WizardStep implements ICondition {
 
     private final List<String> allRoles;
 
+    private UserTO userTO;
+
     protected WebMarkupContainer dynrolesContainer;
-    
+
     public <T extends AnyTO> Roles(final AnyWrapper<?> modelObject) {
         if (!(modelObject.getInnerObject() instanceof UserTO)) {
             throw new IllegalStateException("Invalid instance " + 
modelObject.getInnerObject());
@@ -64,7 +66,7 @@ public class Roles extends WizardStep implements ICondition {
             add(new Label("changed", StringUtils.EMPTY));
         }
 
-        final UserTO entityTO = 
UserTO.class.cast(modelObject.getInnerObject());
+        userTO = UserTO.class.cast(modelObject.getInnerObject());
 
         // -----------------------------------------------------------------
         // Pre-Authorizations
@@ -110,17 +112,21 @@ public class Roles extends WizardStep implements 
ICondition {
         add(dynrolesContainer);
 
         dynrolesContainer.add(new 
AjaxPalettePanel.Builder<String>().build("dynroles",
-                new PropertyModel<>(entityTO, "dynRoles"),
+                new PropertyModel<>(userTO, "dynRoles"),
                 new 
ListModel<>(allRoles)).hideLabel().setEnabled(false).setOutputMarkupId(true));
     }
 
+    public UserTO getUserTO() {
+        return userTO;
+    }
+
     @Override
     public final boolean evaluate() {
         return CollectionUtils.isNotEmpty(allRoles)
                 && 
SyncopeConsoleApplication.get().getSecuritySettings().getAuthorizationStrategy().
                         isActionAuthorized(this, RENDER);
     }
-        
+
     protected List<String> getManagedRoles() {
         return 
SyncopeConsoleApplication.get().getSecuritySettings().getAuthorizationStrategy().
                 isActionAuthorized(this, RENDER)

Reply via email to