private void applyFromCustomization(final UserTO userTO, final Map<String, CustomAttributesInfo> customFormAttributes) { if (customFormAttributes != null && !customFormAttributes.isEmpty()) { // filter PLAIN attributes customizeAttrTOs(userTO.getPlainAttrs(), customFormAttributes.get(SchemaType.PLAIN.name())); // filter DERIVED attributes customizeAttrTOs(userTO.getDerAttrs(), customFormAttributes.get(SchemaType.DERIVED.name())); // filter VIRTUAL attributes customizeAttrTOs(userTO.getVirAttrs(), customFormAttributes.get(SchemaType.VIRTUAL.name())); } }
private void applyFromCustomization(final UserTO userTO, final Map<String, CustomAttributesInfo> customFormAttributes) { if (customFormAttributes != null && !customFormAttributes.isEmpty()) { // filter PLAIN attributes customizeAttrs(userTO.getPlainAttrs(), customFormAttributes.get(SchemaType.PLAIN.name())); // filter DERIVED attributes customizeAttrs(userTO.getDerAttrs(), customFormAttributes.get(SchemaType.DERIVED.name())); // filter VIRTUAL attributes customizeAttrs(userTO.getVirAttrs(), customFormAttributes.get(SchemaType.VIRTUAL.name())); } }
private void completeUserObject(final UserTO userTO, final UserTO selfTO) { // memberships plain and virtual attrs userTO.getMemberships().forEach(updatedTOMemb -> { selfTO.getMemberships().stream(). filter(oldTOMemb -> updatedTOMemb.getGroupKey().equals(oldTOMemb.getGroupKey())). findFirst().ifPresent(oldTOMatchedMemb -> { if (!updatedTOMemb.getPlainAttrs().isEmpty()) { completeAttrs(updatedTOMemb.getPlainAttrs(), oldTOMatchedMemb.getPlainAttrs()); } if (!updatedTOMemb.getVirAttrs().isEmpty()) { completeAttrs(updatedTOMemb.getVirAttrs(), oldTOMatchedMemb.getVirAttrs()); } }); }); // plain attrs completeAttrs(userTO.getPlainAttrs(), selfTO.getPlainAttrs()); // virtual attrs completeAttrs(userTO.getVirAttrs(), selfTO.getVirAttrs()); }
private void completeUserObject(final UserTO userTO, final UserTO selfTO) { // memberships plain and virtual attrs userTO.getMemberships().forEach(updatedTOMemb -> { selfTO.getMemberships().stream(). filter(oldTOMemb -> updatedTOMemb.getGroupKey().equals(oldTOMemb.getGroupKey())). findFirst().ifPresent(oldTOMatchedMemb -> { if (!updatedTOMemb.getPlainAttrs().isEmpty()) { completeAttrs(updatedTOMemb.getPlainAttrs(), oldTOMatchedMemb.getPlainAttrs()); } if (!updatedTOMemb.getVirAttrs().isEmpty()) { completeAttrs(updatedTOMemb.getVirAttrs(), oldTOMatchedMemb.getVirAttrs()); } }); }); // plain attrs completeAttrs(userTO.getPlainAttrs(), selfTO.getPlainAttrs()); // virtual attrs completeAttrs(userTO.getVirAttrs(), selfTO.getVirAttrs()); }
@Transactional(propagation = Propagation.REQUIRES_NEW) @Override public Pair<String, List<PropagationStatus>> create( final UserTO userTO, final boolean storePassword, final boolean disablePwdPolicyCheck, final Boolean enabled, final Set<String> excludedResources, final boolean nullPriorityAsync) { WorkflowResult<Pair<String, Boolean>> created = uwfAdapter.create(userTO, disablePwdPolicyCheck, enabled, storePassword); List<PropagationTaskInfo> taskInfos = propagationManager.getUserCreateTasks( created.getResult().getLeft(), userTO.getPassword(), created.getResult().getRight(), created.getPropByRes(), userTO.getVirAttrs(), excludedResources); PropagationReporter propagationReporter = taskExecutor.execute(taskInfos, nullPriorityAsync); return Pair.of(created.getResult().getLeft(), propagationReporter.getStatuses()); }
public static boolean isCompliant( final UserTO userTO, final Map<String, CustomAttributesInfo> customFormAttributes, final boolean checkDefaultValues) { if (customFormAttributes == null || customFormAttributes.isEmpty()) { return true; } return validateAttributes(EntityTOUtils.buildAttrMap(userTO.getPlainAttrs()), customFormAttributes.get(SchemaType.PLAIN.name()), checkDefaultValues) && validateAttributes(EntityTOUtils.buildAttrMap(userTO.getDerAttrs()), customFormAttributes.get(SchemaType.DERIVED.name()), checkDefaultValues) && validateAttributes(EntityTOUtils.buildAttrMap(userTO.getVirAttrs()), customFormAttributes.get(SchemaType.VIRTUAL.name()), checkDefaultValues); }
public static boolean isCompliant( final UserTO userTO, final Map<String, CustomAttributesInfo> customFormAttributes, final boolean checkDefaultValues) { if (customFormAttributes == null || customFormAttributes.isEmpty()) { return true; } return validateAttributes(EntityTOUtils.buildAttrMap(userTO.getPlainAttrs()), customFormAttributes.get(SchemaType.PLAIN.name()), checkDefaultValues) && validateAttributes(EntityTOUtils.buildAttrMap(userTO.getDerAttrs()), customFormAttributes.get(SchemaType.DERIVED.name()), checkDefaultValues) && validateAttributes(EntityTOUtils.buildAttrMap(userTO.getVirAttrs()), customFormAttributes.get(SchemaType.VIRTUAL.name()), checkDefaultValues); }
userTO.getVirAttrs().stream(). filter(attr -> (attr.getSchema(). contains(SyncopeEnduserConstants.MEMBERSHIP_ATTR_SEPARATOR))). membAttrs.add(attr); }); userTO.getVirAttrs().removeAll(membAttrs);
return attr; }).forEachOrdered(attr -> { userTO.getVirAttrs().add(attr); }); membership.getVirAttrs().clear();
return attr; }).forEachOrdered(attr -> { userTO.getVirAttrs().add(attr); }); membership.getVirAttrs().clear();
userTO.getVirAttrs().stream(). filter(attr -> (attr.getSchema().contains(SyncopeEnduserConstants.MEMBERSHIP_ATTR_SEPARATOR))). forEach((attr) -> { membAttrs.add(attr); }); userTO.getVirAttrs().removeAll(membAttrs);
userTO.getVirAttrs().stream(). filter(attr -> (attr.getSchema().contains(SyncopeEnduserConstants.MEMBERSHIP_ATTR_SEPARATOR))). forEachOrdered((attr) -> { membAttrs.add(attr); }); userTO.getVirAttrs().removeAll(membAttrs);
created.getResult().getValue(), created.getPropByRes(), ((UserTO) actual).getVirAttrs(), excludedResources); PropagationReporter reporter = getPropagationTaskExecutor().execute(taskInfos, nullPriorityAsync);
userTO.getVirAttrs().stream(). filter(attr -> (attr.getSchema(). contains(SyncopeEnduserConstants.MEMBERSHIP_ATTR_SEPARATOR))). membAttrs.add(attr); }); userTO.getVirAttrs().removeAll(membAttrs); auxClasses(userTO.getAuxClasses()). plainAttrs(userTO.getPlainAttrs()). virAttrs(userTO.getVirAttrs()). memberships(userTO.getMemberships()). relationships(userTO.getRelationships()).
responseTO.getAttrs().addAll(userTO.getVirAttrs()); if (StringUtils.isNotBlank(userTO.getUsername())) { responseTO.setUsername(userTO.getUsername());
responseTO.getAttrs().addAll(userTO.getVirAttrs()); if (StringUtils.isNotBlank(userTO.getUsername())) { responseTO.setUsername(userTO.getUsername());
attrs.putAll(EntityTOUtils.buildAttrMap(userTO.getPlainAttrs())); attrs.putAll(EntityTOUtils.buildAttrMap(userTO.getDerAttrs())); attrs.putAll(EntityTOUtils.buildAttrMap(userTO.getVirAttrs())); attrs.put("username", new AttrTO.Builder().schema("username").value(userTO.getUsername()).build());