1 package compbio.spring.security;
3 import org.springframework.security.core.GrantedAuthority;
4 import org.springframework.util.Assert;
7 * Maps groups defined in LDAP to roles for a specific user.
10 * public enum PCacheLDAPAuthority implements GrantedAuthority { ROLE_LDAP_USER;
11 * public String getAuthority() { return name(); } }
13 public final class PCacheLDAPAuthority implements GrantedAuthority {
15 private static final long serialVersionUID = 1;
17 private String role = "ROLE_LDAP_USER";
19 public PCacheLDAPAuthority(String role) {
20 Assert.hasText(role, "A granted authority textual representation is required");
24 public String getAuthority() {
28 public boolean equals(Object obj) {
32 if (obj instanceof PCacheLDAPAuthority) {
33 return role.equals(((PCacheLDAPAuthority) obj).role);
38 public int hashCode() {
39 return this.role.hashCode();
42 public String toString() {