1 19 package org.lucane.common.acl; 20 21 import java.io.Serializable ; 22 23 26 public class AclInfo implements Serializable 27 { 28 private String access; 29 private boolean allow; 30 private String group; 31 private String user; 32 33 41 public AclInfo(String access, boolean allow, String group, String user) 42 { 43 this.access = access; 44 this.allow = allow; 45 this.group = group; 46 this.user = user; 47 } 48 49 52 public String getAccess() { 53 return access; 54 } 55 56 59 public boolean isAllow() { 60 return allow; 61 } 62 63 66 public boolean isDeny() { 67 return !allow; 68 } 69 70 73 public String getGroup() { 74 return group; 75 } 76 79 public String getUser() { 80 return user; 81 } 82 83 public boolean equals(Object other) 84 { 85 if(other instanceof AclInfo) 86 { 87 AclInfo i = (AclInfo)other; 88 if(user != null && !user.equals(i.user)) 89 return false; 90 if(group != null && !group.equals(i.group)) 91 return false; 92 if(i.user != null && !i.user.equals(user)) 93 return false; 94 if(i.group != null && !i.group.equals(group)) 95 return false; 96 97 return access.equals(i.access) && allow == i.allow; 98 } 99 100 return false; 101 } 102 } | Popular Tags |