@Test public final void testGetDenied() { Action write = SystemAction.WRITE; Authority[] authorities = context.getDenied(write); int expected = 1; if (authorities.length != expected) { fail("Denied authorities should be " + expected + " but found " + authorities.length); } authorities = context.getDenied(null); expected = 0; if (authorities.length != expected) { fail("Denied authorities should be " + expected + " but found " + authorities.length); } }
public Authority[] getDenied(Action p) { Set<Authority> authorities = aclDenyDefaults.get(p); if (authorities == null) { authorities = aclDeny.get(p); } if (authorities != null) { Authority[] a = new Authority[authorities.size()]; return authorities.toArray(a); } else { return new Authority[] {}; } }
SecurityContextImpl extends AbstractSecurityContext implements Securable, Cloneable { public Authority[] getDenied(Action p) { Set<Authority> authorities = aclDenyDefaults.get(p); if (authorities == null) { authorities = aclDeny.get(p); } if (authorities != null) { Authority[] a = new Authority[authorities.size()]; return authorities.toArray(a); } else { return new Authority[] {}; } } }
SecurityContextImpl extends AbstractSecurityContext implements Securable, Cloneable { public Authority[] getDenied(Action p) { Set<Authority> authorities = aclDenyDefaults.get(p); if (authorities == null) { authorities = aclDeny.get(p); } if (authorities != null) { Authority[] a = new Authority[authorities.size()]; return authorities.toArray(a); } else { return new Authority[] {}; } } SecurityContextImpl();  SecurityContextImpl(User owner); }
SecurityContextImpl extends AbstractSecurityContext implements Securable, Cloneable { public Authority[] getDenied(Action p) { Set<Authority> authorities = aclDenyDefaults.get(p); if (authorities == null) { authorities = aclDeny.get(p); } if (authorities != null) { Authority[] a = new Authority[authorities.size()]; return authorities.toArray(a); } else { return new Authority[] {}; } } SecurityContextImpl();  SecurityContextImpl(User owner); @Override boolean isDefaultAccess(); void setAllowDenyOrder(Order order); @Override Order getAllowDenyOrder(); @Override void addAccessRule(AccessRule rule); @Override SortedSet<AccessRule> getAccessRules(); void allow(Authority authority, Action action); void allowAll(); void allowAll(Action action); @Override boolean isAllowed(Action action, Authority authority); void allowDefault(Action action, Authority authority); void deny(Authority authority, Action action); void denyDefault(Action action, Authority authority); @Override boolean isDenied(Action action, Authority authority); void denyAll(Action action); void denyAll(); Authority[] getAllowed(Action p); Authority[] getDenied(Action p); Action[] getActions(); static SecurityContextImpl fromXml(Node context); static SecurityContextImpl fromXml(Node context, XPath xpath); String toXml(); Object clone(); }
SecurityContextImpl extends AbstractSecurityContext implements Securable, Cloneable { public Authority[] getDenied(Action p) { Set<Authority> authorities = aclDenyDefaults.get(p); if (authorities == null) { authorities = aclDeny.get(p); } if (authorities != null) { Authority[] a = new Authority[authorities.size()]; return authorities.toArray(a); } else { return new Authority[] {}; } } SecurityContextImpl();  SecurityContextImpl(User owner); @Override boolean isDefaultAccess(); void setAllowDenyOrder(Order order); @Override Order getAllowDenyOrder(); @Override void addAccessRule(AccessRule rule); @Override SortedSet<AccessRule> getAccessRules(); void allow(Authority authority, Action action); void allowAll(); void allowAll(Action action); @Override boolean isAllowed(Action action, Authority authority); void allowDefault(Action action, Authority authority); void deny(Authority authority, Action action); void denyDefault(Action action, Authority authority); @Override boolean isDenied(Action action, Authority authority); void denyAll(Action action); void denyAll(); Authority[] getAllowed(Action p); Authority[] getDenied(Action p); Action[] getActions(); static SecurityContextImpl fromXml(Node context); static SecurityContextImpl fromXml(Node context, XPath xpath); String toXml(); Object clone();  }