@Override public <T extends AnyTO> T newAnyTO() { T result = null; switch (anyTypeKind) { case USER: result = (T) new UserTO(); break; case GROUP: result = (T) new GroupTO(); break; case ANY_OBJECT: result = (T) new AnyObjectTO(); break; default: } return result; }
public GroupTemplateWizardBuilder( final TemplatableTO templatable, final List<String> anyTypeClasses, final GroupFormLayoutInfo formLayoutInfo, final PageReference pageRef) { super(null, anyTypeClasses, formLayoutInfo, pageRef); this.templatable = templatable; if (templatable.getTemplates().containsKey(AnyTypeKind.GROUP.name())) { setItem(new GroupWrapper(GroupTO.class.cast(templatable.getTemplates().get(AnyTypeKind.GROUP.name())))); } else { GroupTO groupTO = new GroupTO(); if (templatable instanceof RealmTO) { groupTO.setRealm(String.format("'%s'", RealmTO.class.cast(templatable).getFullPath())); } setItem(new GroupWrapper(groupTO)); } }
@PreAuthorize("hasRole('" + StandardEntitlement.GROUP_DELETE + "')") @Override public ProvisioningResult<GroupTO> delete(final String key, final boolean nullPriorityAsync) { GroupTO group = binder.getGroupTO(key); Pair<GroupTO, List<LogicActions>> before = beforeDelete(group); Set<String> effectiveRealms = RealmUtils.getEffective( AuthContextUtils.getAuthorizations().get(StandardEntitlement.GROUP_DELETE), before.getLeft().getRealm()); securityChecks(effectiveRealms, before.getLeft().getRealm(), before.getLeft().getKey()); List<Group> ownedGroups = groupDAO.findOwnedByGroup(before.getLeft().getKey()); if (!ownedGroups.isEmpty()) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.GroupOwnership); sce.getElements().addAll(ownedGroups.stream(). map(g -> g.getKey() + " " + g.getName()).collect(Collectors.toList())); throw sce; } List<PropagationStatus> statuses = provisioningManager.delete(before.getLeft().getKey(), nullPriorityAsync); GroupTO groupTO = new GroupTO(); groupTO.setKey(before.getLeft().getKey()); return afterDelete(groupTO, statuses, before.getRight()); }
public GroupTO toGroupTO(final SCIMGroup group) { if (!GROUP_SCHEMAS.equals(group.getSchemas())) { throw new BadRequestException(ErrorType.invalidValue); } GroupTO groupTO = new GroupTO(); groupTO.setRealm(SyncopeConstants.ROOT_REALM); groupTO.setKey(group.getId()); groupTO.setName(group.getDisplayName()); return groupTO; }
@Transactional(readOnly = true) @Override public GroupTO getGroupTO(final Group group, final boolean details) { GroupTO groupTO = new GroupTO();
GroupTO previousGroupTO; if (remediationTO.getAnyURPayload() == null) { newGroupTO = new GroupTO(); EntityTOUtils.toAnyTO(remediationTO.getAnyCRPayload(), newGroupTO); previousGroupTO = null;
: SyncopeClient.getGroupSearchConditionBuilder().inDynRealms(dynRealm).query(); final GroupTO groupTO = new GroupTO(); groupTO.setRealm(realmTO.getFullPath()); panel = new GroupDirectoryPanel.Builder(