if (this.executionSubject == null) { this.executionSubject = groupPrincipalCallback.getSubject(); } else if (!this.executionSubject.equals(groupPrincipalCallback.getSubject())) { if (this.executionSubject == null) { this.executionSubject = callerPrincipalCallback.getSubject(); } else if (!this.executionSubject.equals(callerPrincipalCallback.getSubject())) { if (this.executionSubject == null) { this.executionSubject = passwordValidationCallback.getSubject(); } else if (!this.executionSubject.equals(passwordValidationCallback.getSubject())) {
public Boolean run() { return s1 != null ? s1.equals(s2) : s2 == null; } });
public Boolean run() { return s1 != null ? s1.equals(s2) : s2 == null; } });
private boolean isNotTheSameLocker (final Subject unlocker, final Subject locker) { if (locker == null) return false; return ! locker.equals(unlocker); }
public boolean equals(Object object) { boolean result = false; if (object == this) { result = true; } else if (object instanceof OracleUser) { OracleUser other = (OracleUser) object; result = this.subject.equals(other.subject); } return result; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SubjectCRIKey that = (SubjectCRIKey) o; if (hashcode != that.hashcode) return false; if (cri != null ? !cri.equals(that.cri) : that.cri != null) return false; if (subject != null ? !subject.equals(that.subject) : that.subject != null) return false; return true; }
public Object run() { Object value = null; if( other == null ) value = Integer.valueOf(subject.hashCode()); else value = Boolean.valueOf(subject.equals(other)); return value; } static int hashCode(Subject subject)
/** * Verify if two Subject's are equal * @param s1 The first Subject * @param s2 The second Subject * @return True if equal; otherwise false */ static boolean equals(final Subject s1, final Subject s2) { if (System.getSecurityManager() == null) return s1 != null ? s1.equals(s2) : s2 == null; Boolean equals = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { public Boolean run() { return s1 != null ? s1.equals(s2) : s2 == null; } }); return equals.booleanValue(); } }
/** * Verify if two Subject's are equal * @param s1 The first Subject * @param s2 The second Subject * @return True if equal; otherwise false */ static boolean equals(final Subject s1, final Subject s2) { if (System.getSecurityManager() == null) return s1 != null ? s1.equals(s2) : s2 == null; Boolean equals = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { public Boolean run() { return s1 != null ? s1.equals(s2) : s2 == null; } }); return equals.booleanValue(); } }
private boolean runningAsSubject() { return _subject.equals(Subject.getSubject(AccessController.getContext())); }
private boolean runningAsSubject() { return getAuthorizedSubject().equals(Subject.getSubject(AccessController.getContext())); }
/** * Returns true if the given workitem (id) has been locked by another * subject (principal). */ public boolean isLockedBySomeoneElse (final Subject s, final FlowExpressionId workitemId) { final Lock l = getLock(workitemId); if (l == null) return false; return ! l.getLocker().equals(s); }
public boolean hasLockOn (Subject s, FlowExpressionId expressionId) { if (log.isDebugEnabled()) log.debug(getName()+" hasLockOn() "+expressionId); final Lock lock = (Lock)this.lockMap.get(expressionId); if (log.isDebugEnabled()) log.debug(getName()+" hasLockOn() found lock "+lock); if (lock == null) return false; //log.debug("hasLockOn() subject >"+s+"<"); //log.debug("hasLockOn() locker >"+lock.getLocker()+"<"); if ( ! s.equals(lock.getLocker())) return false; lock.touch(); // ensure that the dispatching (that happens next) will be ok return true; }
/** * Will return true if the given subject has a lock on the workitem * designated by its lastExpressionId. */ public boolean hasLockOn (Subject s, FlowExpressionId expressionId) { if (log.isDebugEnabled()) log.debug(getName()+" hasLockOn() "+expressionId); final Lock lock = (Lock)this.lockMap.get(expressionId); if (log.isDebugEnabled()) log.debug(getName()+" hasLockOn() found lock "+lock); if (lock == null) return false; //log.debug("hasLockOn() subject >"+s+"<"); //log.debug("hasLockOn() locker >"+lock.getLocker()+"<"); if ( ! s.equals(lock.getLocker())) return false; lock.touch(); // ensure that the dispatching (that happens next) will be ok return true; }
public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Target)) { return false; } final Target target = (Target) o; if (!m_actionAttributes.equals(target.m_actionAttributes)) { return false; } if (!m_resourceAttributes.equals(target.m_resourceAttributes)) { return false; } if (!m_subject.equals(target.m_subject)) { return false; } return true; }
private boolean isMatch(final AbstractManagedConnectionImpl candidateConn, final ConnectionRequestInfo crInfo, final Subject subject) throws ResourceAdapterInternalException { boolean result = false; final ConnectionRequestInfo candidate = candidateConn.getConnectionRequestInfo(); if (candidate.equals(crInfo) && (subject == null || subject.equals(candidateConn.getSubject()))) { try { validateReference(candidateConn, subject); result = true; } catch (Exception thrown) { result = false; } } return result; }
public boolean securityMatches(ManagedConnectionInfo other) { return ( subject == null ? other.getSubject() == null : subject.equals(other.getSubject())) && (connectionRequestInfo == null ? other.getConnectionRequestInfo() == null : connectionRequestInfo.equals(other.getConnectionRequestInfo())); }
@Override public boolean fold(Message message) { if (message.getClass().equals(PnfsGetCacheLocationsMessage.class)) { PnfsId pnfsId = getPnfsId(); String path = getPnfsPath(); PnfsGetCacheLocationsMessage msg = (PnfsGetCacheLocationsMessage) message; if ((pnfsId == null || pnfsId.equals(msg.getPnfsId())) && (path == null || path.equals(msg.getPnfsPath())) && (getSubject().equals(msg.getSubject()))) { setPnfsId(msg.getPnfsId()); setPnfsPath(msg.getPnfsPath()); setCacheLocations(msg.getCacheLocations()); return true; } } return false; } }
public static boolean sameSubject(DQPWorkContext workContext) { Object currentContext = workContext.getSecurityHelper().getSecurityContext(); if (currentContext != null) { Subject currentUser = workContext.getSecurityHelper().getSubjectInContext(workContext.getSecurityDomain()); if (workContext.getSubject() != null && currentUser != null && workContext.getSubject().equals(currentUser)) { return true; } if (currentUser == null && workContext.getSubject() == null) { return true; //unauthenticated } } return false; }
@Override public boolean fold(Message message) { if (message instanceof PnfsGetFileAttributes) { PnfsId pnfsId = getPnfsId(); String path = getPnfsPath(); Set<FileAttribute> requested = getRequestedAttributes(); PnfsGetFileAttributes other = (PnfsGetFileAttributes) message; if ((pnfsId == null || pnfsId.equals(other.getPnfsId())) && (path == null || path.equals(other.getPnfsPath())) && (getSubject().equals(other.getSubject())) && (other.getRequestedAttributes().containsAll(requested))) { setPnfsId(other.getPnfsId()); setPnfsPath(other.getPnfsPath()); setFileAttributes(other.getFileAttributes()); return true; } } return false; }