1 19 20 package com.sslexplorer.policyframework; 21 22 import java.util.Calendar ; 23 import java.util.Collections ; 24 import java.util.List ; 25 26 public class DefaultAccessRights extends AbstractResource implements AccessRights { 27 28 private List <AccessRight> permissions; 29 private List rules; 30 private String permissionClass; 31 32 public DefaultAccessRights(int realmID, int resourceID, String resourceName, String resourceDescription, List <AccessRight> permissions, String permissionClass, Calendar dateCreated, Calendar dateAmended) { 33 super(realmID, PolicyConstants.ACCESS_RIGHTS_RESOURCE_TYPE, resourceID, resourceName, resourceDescription, dateCreated, dateAmended); 34 this.permissions = permissions == null ? Collections.EMPTY_LIST : permissions; 35 this.permissionClass = permissionClass; 36 } 37 38 public void addAccessRight(AccessRight perm) { 39 permissions.add(perm); 40 } 41 42 public void removeAccessRight(AccessRight perm) { 43 permissions.remove(perm); 44 } 45 46 public List <AccessRight> getAccessRights() { 47 return permissions; 48 } 49 50 public List getRules() { 51 return rules; 52 } 53 54 public void addRule(Rule rule) { 55 rules.add(rule); 56 } 57 58 public void removeRule(Rule rule) { 59 rules.remove(rule); 60 } 61 62 public String getAccessRightsClass() { 63 return permissionClass; 64 } 65 66 public boolean containsAccessRight(AccessRight accessRight) { 67 return permissions.contains(accessRight); 68 } 69 } 70 | Popular Tags |