package compbio.spring.security; import org.springframework.security.core.GrantedAuthority; import org.springframework.util.Assert; /** * The class implements the standard granted authority for Spring Security Not * used in the current version of ProteoCache * * @version 1.0 January 2014 * * @author Alexaner Sherstnev */ public final class PCacheLDAPAuthority implements GrantedAuthority { private static final long serialVersionUID = 1; private String role = "ROLE_LDAP_USER"; public PCacheLDAPAuthority(String role) { Assert.hasText(role, "A text representation of the granted authority is required"); this.role = role; } public String getAuthority() { return role; } public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof PCacheLDAPAuthority) { return role.equals(((PCacheLDAPAuthority) obj).role); } return false; } public int hashCode() { return this.role.hashCode(); } public String toString() { return this.role; } }