public boolean contains(final S schema) { if (forSelfContains(schema)) { return true; } return forMembershipsContains(schema); }
private boolean doesSchemaExist(final SchemaType schemaType, final String name) { boolean found; switch (schemaType) { case VIRTUAL: found = virSchemaDAO.find(name) != null; break; case DERIVED: found = derSchemaDAO.find(name) != null; break; case PLAIN: found = plainSchemaDAO.find(name) != null; break; default: found = false; } return found; }
public boolean isPwdResetRequiringSecurityQuestions() { return confDAO.find("passwordReset.securityQuestion", true); }
@PreAuthorize("hasRole('" + StandardEntitlement.CONFIGURATION_DELETE + "')") public void delete(final String schema) { Optional<? extends CPlainAttr> conf = confDAO.find(schema); if (!conf.isPresent()) { PlainSchema plainSchema = plainSchemaDAO.find(schema); if (plainSchema == null) { throw new NotFoundException("Configuration schema " + schema); } } confDAO.delete(schema); }
@PreAuthorize("isAuthenticated()") public TypeExtensionTO readTypeExtension(final String groupName) { Group group = groupDAO.findByName(groupName); if (group == null) { throw new NotFoundException("Group " + groupName); } Optional<? extends TypeExtension> typeExt = group.getTypeExtension(anyTypeDAO.findUser()); if (!typeExt.isPresent()) { throw new NotFoundException("TypeExtension in " + groupName + " for users"); } return groupDataBinder.getTypeExtensionTO(typeExt.get()); }
@PreAuthorize("hasRole('" + StandardEntitlement.SCHEMA_DELETE + "')") public void delete(final SchemaType schemaType, final String schemaKey) { if (!doesSchemaExist(schemaType, schemaKey)) { throw new NotFoundException(schemaType + "/" + schemaKey); } switch (schemaType) { case VIRTUAL: virSchemaDAO.delete(schemaKey); break; case DERIVED: derSchemaDAO.delete(schemaKey); break; case PLAIN: default: plainSchemaDAO.delete(schemaKey); } }
@PreAuthorize("hasRole('" + StandardEntitlement.RESOURCE_HISTORY_DELETE + "')") public void delete(final String key) { ExternalResourceHistoryConf resourceHistoryConf = resourceHistoryConfDAO.find(key); if (resourceHistoryConf == null) { throw new NotFoundException("Resource History Conf '" + key + "'"); } resourceHistoryConfDAO.delete(key); }
@PreAuthorize("hasRole('" + StandardEntitlement.CONNECTOR_HISTORY_DELETE + "')") public void delete(final String key) { ConnInstanceHistoryConf connInstanceHistoryConf = connInstanceHistoryConfDAO.find(key); if (connInstanceHistoryConf == null) { throw new NotFoundException("Connector History Conf '" + key + "'"); } connInstanceHistoryConfDAO.delete(key); }
@PreAuthorize("hasRole('" + StandardEntitlement.REMEDIATION_DELETE + "')") public void delete(final String key) { Remediation remediation = remediationDAO.find(key); if (remediation == null) { LOG.error("Could not find remediation '" + key + "'"); throw new NotFoundException(key); } remediationDAO.delete(remediation); }
@PreAuthorize("hasRole('" + OIDCClientEntitlement.OP_DELETE + "')") public void delete(final String key) { OIDCProvider op = opDAO.find(key); if (op == null) { throw new NotFoundException("OIDC Provider '" + key + "'"); } opDAO.delete(key); }
@PreAuthorize("hasRole('" + StandardEntitlement.REPORT_DELETE + "')") @Override public ExecTO deleteExecution(final String executionKey) { ReportExec reportExec = reportExecDAO.find(executionKey); if (reportExec == null) { throw new NotFoundException("Report execution " + executionKey); } ExecTO reportExecToDelete = binder.getExecTO(reportExec); reportExecDAO.delete(reportExec); return reportExecToDelete; }
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_DELETE + "')") @Override public ExecTO deleteExecution(final String execKey) { TaskExec taskExec = taskExecDAO.find(execKey); if (taskExec == null) { throw new NotFoundException("Task execution " + execKey); } ExecTO taskExecutionToDelete = binder.getExecTO(taskExec); taskExecDAO.delete(taskExec); return taskExecutionToDelete; }
protected String getActualKey(final AnyDAO<?> dao, final String pretendingKey) { String actualKey = pretendingKey; if (!SyncopeConstants.UUID_PATTERN.matcher(pretendingKey).matches()) { actualKey = dao.findKey(pretendingKey); if (actualKey == null) { throw new NotFoundException("User, Group or Any Object for " + pretendingKey); } } return actualKey; }
protected Date findLastChange(final String key) { Date lastChange = getAnyDAO().findLastChange(key); if (lastChange == null) { throw new NotFoundException("User, Group or Any Object for " + key); } return lastChange; }
@Override protected String doExecute(final boolean dryRun) throws JobExecutionException { if (!dryRun) { int deleted = accessTokenDAO.deleteExpired(); LOG.debug("Successfully deleted {} expired access tokens", deleted); } return "SUCCESS"; }
private SchemaType find(final String key) { Schema schema = plainSchemaDAO.find(key); if (schema == null) { schema = derSchemaDAO.find(key); if (schema == null) { schema = virSchemaDAO.find(key); if (schema == null) { return null; } else { return SchemaType.VIRTUAL; } } else { return SchemaType.DERIVED; } } else { return SchemaType.PLAIN; } }
public boolean contains(final String schema) { if (forSelfContains(schema)) { return true; } return forMembershipsContains(schema); }
public boolean isSelfRegAllowed() { return confDAO.find("selfRegistration.allowed", false); }
public boolean isPwdResetAllowed() { return confDAO.find("passwordReset.allowed", false); }