public List<JetspeedPrincipal> getAssociatedFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){ Long defaultDomainId = getDefaultSecurityDomainId(); return getAssociatedFrom(principalFromName, from, to, associationName, defaultDomainId, defaultDomainId); } //
public List<String> getAssociatedNamesFrom(String principalFromName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){ Long defaultDomainId = getDefaultSecurityDomainId(); return getAssociatedNamesFrom(principalFromName, from, to, associationName, defaultDomainId, defaultDomainId); }
public List<String> getAssociatedNamesFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){ Long defaultDomainId = getDefaultSecurityDomainId(); return getAssociatedNamesFrom(principalFromId, from, to, associationName, defaultDomainId, defaultDomainId); }
public List<String> getAssociatedNamesTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){ Long defaultDomainId = getDefaultSecurityDomainId(); return getAssociatedNamesTo(principalToName, from, to, associationName, defaultDomainId, defaultDomainId); }
public List<JetspeedPrincipal> getPrincipals(String nameFilter, JetspeedPrincipalType type) { return getPrincipals(nameFilter, type, getDefaultSecurityDomainId()); }
public List<JetspeedPrincipal> getAssociatedFrom(Long principalFromId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){ Long defaultDomainId = getDefaultSecurityDomainId(); return getAssociatedFrom(principalFromId, from, to, associationName, defaultDomainId, defaultDomainId); }
public List<JetspeedPrincipal> getAssociatedTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){ Long defaultDomainId = getDefaultSecurityDomainId(); return getAssociatedTo(principalToName, from, to, associationName, defaultDomainId, defaultDomainId); }
public List<String> getAssociatedNamesTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){ Long defaultDomainId = getDefaultSecurityDomainId(); return getAssociatedNamesTo(principalToId, from, to, associationName, defaultDomainId, defaultDomainId); }
public List<JetspeedPrincipal> getPrincipals(PersistentJetspeedPermission permission, String principalType) { return getPrincipals(permission, principalType, getDefaultSecurityDomainId()); }
public void grantPermissionOnlyTo(PersistentJetspeedPermission permission, String principalType, List<JetspeedPrincipal> principals) throws SecurityException { grantPermissionOnlyTo(permission, principalType, principals, getDefaultSecurityDomainId()); }
public List<JetspeedPrincipal> getAssociatedTo(Long principalToId, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName){ Long defaultDomainId = getDefaultSecurityDomainId(); return getAssociatedTo(principalToId, from, to, associationName, defaultDomainId, defaultDomainId); }
public JetspeedPrincipal getPrincipal(String principalName, JetspeedPrincipalType type) { return getPrincipal(principalName, type, getDefaultSecurityDomainId()); }
public List<String> getPrincipalNames(String nameFilter, JetspeedPrincipalType type) { return getPrincipalNames(nameFilter, type, getDefaultSecurityDomainId()); }
public List<JetspeedPrincipal> getPrincipalsByAttribute(String attributeName, String attributeValue, JetspeedPrincipalType type) { return getPrincipalsByAttribute(attributeName, attributeValue, type, getDefaultSecurityDomainId()); }
public boolean principalExists(String principalName, JetspeedPrincipalType type) { return principalExists(principalName, type, getDefaultSecurityDomainId()); }
public PasswordCredential getPasswordCredential(String userName){ return getPasswordCredential(userName,getDefaultSecurityDomainId()); }
public List<PasswordCredential> getHistoricPasswordCredentials(User user){ return getHistoricPasswordCredentials(user,getDefaultSecurityDomainId()); }
public JetspeedPrincipalResultList getPrincipals(JetspeedPrincipalQueryContext queryContext, JetspeedPrincipalType type) { return getPrincipals(queryContext, type, getDefaultSecurityDomainId()); }
public void addPrincipal(JetspeedPrincipal principal, Set<JetspeedPrincipalAssociationReference> associations) throws SecurityException { if (principal.getDomainId() == null && principal instanceof TransientJetspeedPrincipal) { ((TransientJetspeedPrincipal)principal).setDomainId(getDefaultSecurityDomainId()); } if (principalExists(principal)) { throw new SecurityException(SecurityException.PRINCIPAL_ALREADY_EXISTS.createScoped(principal.getType().getName(), principal.getName())); } try { getPersistenceBrokerTemplate().store(principal); // evict from and put in cache to notify jspmCache.evictPrincipal(principal.getId()); jspmCache.putPrincipal(principal.getId(), principal); } catch (Exception pbe) { KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager", "addPrincipal", pbe.getMessage()); logger.error(msg, pbe); throw new SecurityException(msg, pbe); } // Note: the (optional) required associations are expected to be stored by the calling JetspeedPrincipalManager }
public void revokeAllPermissions(JetspeedPrincipal principal) throws SecurityException { Long principalId = null; Criteria criteria = new Criteria(); if (principal.isTransient() || principal.getId() == null) { Long securityDomain = ((principal.getDomainId() != null) ? principal.getDomainId() : getDefaultSecurityDomainId()); principalId = getPrincipalId(principal.getName(), principal.getType().getName(), securityDomain); } else { principalId = principal.getId(); } criteria.addEqualTo("principalId", principalId); Query query = QueryFactory.newQuery(JetspeedPrincipalPermission.class,criteria); try { getPersistenceBrokerTemplate().deleteByQuery(query); // evict from principal cache to notify jspmCache.evictPrincipal(principalId); } catch (Exception pbe) { KeyedMessage msg = SecurityException.UNEXPECTED.create("JetspeedSecurityPersistenceManager", "revokeAllPermissions", pbe.getMessage()); logger.error(msg, pbe); throw new SecurityException(msg, pbe); } }