private List<ExecTO> getUpdatedRecent() { List<ExecTO> updatedRecent = new ArrayList<>(); if (SyncopeConsoleSession.get().owns(StandardEntitlement.TASK_LIST)) { updatedRecent.addAll(taskRestClient.listRecentExecutions(10)); } if (SyncopeConsoleSession.get().owns(StandardEntitlement.REPORT_LIST)) { updatedRecent.addAll(reportRestClient.listRecentExecutions(10)); } return updatedRecent; }
@Override public List<RemediationTO> getObject() { List<RemediationTO> updatedRemediations; if (SyncopeConsoleSession.get().owns(StandardEntitlement.REMEDIATION_LIST) && SyncopeConsoleSession.get().owns(StandardEntitlement.REMEDIATION_READ)) { updatedRemediations = restClient.getRemediations(1, MAX_SIZE, new SortParam<>("instant", true)); } else { updatedRemediations = Collections.<RemediationTO>emptyList(); } return updatedRemediations; } };
private List<JobTO> getUpdatedAvailable() { List<JobTO> updatedAvailable = new ArrayList<>(); if (SyncopeConsoleSession.get().owns(StandardEntitlement.NOTIFICATION_LIST)) { JobTO notificationJob = notificationRestClient.getJob(); if (notificationJob != null) { updatedAvailable.add(notificationJob); } } if (SyncopeConsoleSession.get().owns(StandardEntitlement.TASK_LIST)) { updatedAvailable.addAll(taskRestClient.listJobs()); } if (SyncopeConsoleSession.get().owns(StandardEntitlement.REPORT_LIST)) { updatedAvailable.addAll(reportRestClient.listJobs()); } return updatedAvailable; }
private void checkAddButton(final String adminRealm) { boolean enabled = SyncopeConsoleSession.get().owns(StandardEntitlement.RESOURCE_UPDATE, adminRealm) && !getAnyTypes().getObject().isEmpty(); addAjaxLink.setVisible(enabled); objectTypeTogglePanel.setEnabled(enabled); } }
/** * Retrieve dyn group memberships. */ private void reloadDynMemberships() { GroupFiqlSearchConditionBuilder searchConditionBuilder = SyncopeClient.getGroupSearchConditionBuilder(); List<CompleteCondition> conditions = GroupableRelatableTO.class.cast(anyTO).getDynMemberships(). stream().map(membership -> searchConditionBuilder.is("key").equalTo(membership.getGroupKey()).wrap()). collect(Collectors.toList()); dynMemberships = new ArrayList<>(); if (SyncopeConsoleSession.get().owns(StandardEntitlement.GROUP_SEARCH) && !conditions.isEmpty()) { dynMemberships.addAll(groupRestClient.search( SyncopeConstants.ROOT_REALM, searchConditionBuilder.or(conditions).query(), -1, -1, new SortParam<>("name", true), null).stream().map(GroupTO::getName).collect(Collectors.toList())); } }
private void populateAnyTypes(final String resourceKey) { anyTypes.clear(); if (resourceKey != null) { ResourceTO resource = resourceRestClient.read(resourceKey); String adminRealm = getAdminRealm(resource.getConnector()); if (SyncopeConsoleSession.get().owns(StandardEntitlement.RESOURCE_READ, adminRealm)) { selectedResource = resource; selectedResource.getProvisions().forEach(provisionTO -> { anyTypes.put(provisionTO.getAnyType(), provisionTO.getObjectClass()); }); } } }
protected AnyDirectoryPanel(final String id, final Builder<A, E> builder, final boolean wizardInModal) { super(id, builder, wizardInModal); if (SyncopeConsoleSession.get().owns(String.format("%s_CREATE", builder.type), builder.realm) && builder.realm.startsWith(SyncopeConstants.ROOT_REALM)) { MetaDataRoleAuthorizationStrategy.authorizeAll(addAjaxLink, RENDER); setReadOnly(!SyncopeConsoleSession.get().owns(String.format("%s_UPDATE", builder.type), builder.realm)); } else { setReadOnly(!SyncopeConsoleSession.get().owns(String.format("%s_UPDATE", builder.type), builder.dynRealm));
@Override protected void onUpdate(final AjaxRequestTarget target) { if (selectedResource != null) { String adminRealm = getAdminRealm(selectedResource.getConnector()); if (SyncopeConsoleSession.get().owns(StandardEntitlement.CONNECTOR_READ, adminRealm)) { extAttrName.setChoices(getExtAttrNames()); target.add(extAttrName); } } } });
pageParameters.add("selectedIndex", 1); responsePage = Realms.class; isAuthorized = SyncopeConsoleSession.get().owns(StandardEntitlement.USER_SEARCH); break; pageParameters.add("selectedIndex", 2); responsePage = Realms.class; isAuthorized = SyncopeConsoleSession.get().owns(StandardEntitlement.GROUP_SEARCH); break; isAuthorized = SyncopeConsoleSession.get().owns(label + "_SEARCH"); } else { responsePage = Security.class; isAuthorized = SyncopeConsoleSession.get().owns(StandardEntitlement.ROLE_LIST); isAuthorized = SyncopeConsoleSession.get().owns(label + "_SEARCH"); break;
@Override public void onClick(final AjaxRequestTarget target) { ConnInstanceTO connInstance = connectorRestClient.read(String.class.cast(node.getKey())); final IModel<ConnInstanceTO> model = new CompoundPropertyModel<>(connInstance); modal.setFormModel(model); target.add(modal.setContent(new ConnectorWizardBuilder(connInstance, pageRef). build(BaseModal.CONTENT_ID, SyncopeConsoleSession.get(). owns(StandardEntitlement.CONNECTOR_UPDATE, connInstance.getAdminRealm()) ? AjaxWizard.Mode.EDIT : AjaxWizard.Mode.READONLY))); modal.header( new Model<>(MessageFormat.format(getString("connector.edit"), connInstance.getDisplayName()))); modal.show(true); }
if (SyncopeConsoleSession.get().owns(StandardEntitlement.REPORT_LIST)) { exec = restClient.listRecentExecutions(ROWS).stream(). filter(e -> reconciliationReportKey.equals(e.getRefKey())).findFirst();
@Override public void onClick(final AjaxRequestTarget target) { ResourceTO resource = resourceRestClient.read(node.getKey()); ConnInstanceTO connInstance = connectorRestClient.read(resource.getConnector()); IModel<ResourceTO> model = new CompoundPropertyModel<>(resource); modal.setFormModel(model); target.add(modal.setContent(new ResourceWizardBuilder(resource, pageRef). build(BaseModal.CONTENT_ID, SyncopeConsoleSession.get(). owns(StandardEntitlement.RESOURCE_UPDATE, connInstance.getAdminRealm()) ? AjaxWizard.Mode.EDIT : AjaxWizard.Mode.READONLY))); modal.header(new Model<>(MessageFormat.format(getString("resource.edit"), node.getKey()))); modal.show(true); }
@Override public void onClick(final AjaxRequestTarget target) { ResourceTO resource = resourceRestClient.read(node.getKey()); ConnInstanceTO connInstance = connectorRestClient.read(resource.getConnector()); if (SyncopeConsoleSession.get(). owns(StandardEntitlement.RESOURCE_UPDATE, connInstance.getAdminRealm())) { provisionModal.addSubmitButton(); } else { provisionModal.removeSubmitButton(); } IModel<ResourceTO> model = new CompoundPropertyModel<>(resource); provisionModal.setFormModel(model); target.add(provisionModal.setContent( new ResourceProvisionPanel(provisionModal, resource, connInstance.getAdminRealm(), pageRef))); provisionModal.header(new Model<>(MessageFormat.format(getString("resource.edit"), node.getKey()))); provisionModal.show(true); }
populate(); Pair<IModel<Map<String, String>>, Integer> groupInfo = SyncopeConsoleSession.get().owns(StandardEntitlement.GROUP_SEARCH) ? Pair.of(groupNames, groupRestClient.count(SyncopeConstants.ROOT_REALM, null, null)) : Pair.of(groupNames, 0);
protected RoleDirectoryPanel(final String id, final Builder builder) { super(id, builder); MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.ROLE_CREATE); setReadOnly(!SyncopeConsoleSession.get().owns(StandardEntitlement.ROLE_UPDATE)); disableCheckBoxes(); setShowResultPage(true); modal.size(Modal.Size.Large); initResultTable(); addOuterObject(utilityModal); setWindowClosedReloadCallback(utilityModal); utilityModal.size(Modal.Size.Large); utilityModal.addSubmitButton(); addOuterObject(membersModal); membersModal.size(Modal.Size.Large); }
protected DynRealmDirectoryPanel(final String id, final Builder builder) { super(id, builder); MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.DYNREALM_CREATE); setReadOnly(!SyncopeConsoleSession.get().owns(StandardEntitlement.DYNREALM_UPDATE));
if (SyncopeConsoleSession.get().owns(StandardEntitlement.REPORT_READ)) { try { reconciliationReport = restClient.read(reconciliationReportKey);
protected ApplicationDirectoryPanel(final String id, final Builder builder) { super(id, builder); MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.APPLICATION_CREATE); setReadOnly(!SyncopeConsoleSession.get().owns(StandardEntitlement.APPLICATION_UPDATE));
if (SyncopeConsoleSession.get().owns(action.getEntitlements(), action.getRealms())) { MetaDataRoleAuthorizationStrategy.authorizeAll(actionLink, RENDER); } else {