[SYNCOPE-1333] fix into VirAttr step in order to retrieve virtual attributes from...
authorfmartelli <fabio.martelli@gmail.com>
Tue, 10 Jul 2018 08:50:23 +0000 (10:50 +0200)
committerfmartelli <fabio.martelli@gmail.com>
Tue, 10 Jul 2018 08:52:24 +0000 (10:52 +0200)
client/console/src/main/java/org/apache/syncope/client/console/wizards/any/VirAttrs.java

index 7850fe9..79d58da 100644 (file)
@@ -34,6 +34,7 @@ import org.apache.syncope.client.console.wizards.AjaxWizard;
 import org.apache.syncope.common.lib.EntityTOUtils;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.GroupableRelatableTO;
 import org.apache.syncope.common.lib.to.MembershipTO;
 import org.apache.syncope.common.lib.to.VirSchemaTO;
 import org.apache.syncope.common.lib.types.SchemaType;
@@ -145,7 +146,8 @@ public class VirAttrs extends AbstractAttrs<VirSchemaTO> {
     protected void setAttrs(final MembershipTO membershipTO) {
         List<AttrTO> attrs = new ArrayList<>();
 
-        Map<String, AttrTO> attrMap = EntityTOUtils.buildAttrMap(anyTO.getVirAttrs());
+        Map<String, AttrTO> attrMap = EntityTOUtils.buildAttrMap(
+                GroupableRelatableTO.class.cast(anyTO).getMembership(membershipTO.getGroupKey()).getVirAttrs());
 
         attrs.addAll(membershipSchemas.get(membershipTO.getGroupKey()).values().stream().map(schema -> {
             AttrTO attrTO = new AttrTO();