/** * Add user to the names of users allowed for this service. * * @param user * The user name */ public void addUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be added"); } if (!isAllAllowed()) { users.add(user); } }
/** * Remove user from the names of users allowed for this service. * * @param user * The user name */ public void removeUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be removed"); } if (!isAllAllowed()) { users.remove(user); } }
/** * Remove group from the names of groups allowed for this service. * * @param group * The group name */ public void removeGroup(String group) { if (isWildCardACLValue(group)) { throw new IllegalArgumentException("Group " + group + " can not be removed"); } if (!isAllAllowed()) { groups.remove(group); } }
/** * Add group to the names of groups allowed for this service. * * @param group * The group name */ public void addGroup(String group) { if (isWildCardACLValue(group)) { throw new IllegalArgumentException("Group " + group + " can not be added"); } if (!isAllAllowed()) { List<String> groupsList = new LinkedList<String>(); groupsList.add(group); groupsMapping.cacheGroupsAdd(groupsList); groups.add(group); } }
/** * Remove user from the names of users allowed for this service. * * @param user * The user name */ public void removeUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be removed"); } if (!isAllAllowed()) { users.remove(user); } }
/** * Remove user from the names of users allowed for this service. * * @param user * The user name */ public void removeUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be removed"); } if (!isAllAllowed()) { users.remove(user); } }
/** * Add user to the names of users allowed for this service. * * @param user * The user name */ public void addUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be added"); } if (!isAllAllowed()) { users.add(user); } }
/** * Remove user from the names of users allowed for this service. * * @param user * The user name */ public void removeUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be removed"); } if (!isAllAllowed()) { users.remove(user); } }
/** * Add user to the names of users allowed for this service. * * @param user * The user name */ public void addUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be added"); } if (!isAllAllowed()) { users.add(user); } }
/** * Remove user from the names of users allowed for this service. * * @param user * The user name */ public void removeUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be removed"); } if (!isAllAllowed()) { users.remove(user); } }
/** * Add user to the names of users allowed for this service. * * @param user * The user name */ public void addUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be added"); } if (!isAllAllowed()) { users.add(user); } }
/** * Add user to the names of users allowed for this service. * * @param user * The user name */ public void addUser(String user) { if (isWildCardACLValue(user)) { throw new IllegalArgumentException("User " + user + " can not be added"); } if (!isAllAllowed()) { users.add(user); } }
/** * Remove group from the names of groups allowed for this service. * * @param group * The group name */ public void removeGroup(String group) { if (isWildCardACLValue(group)) { throw new IllegalArgumentException("Group " + group + " can not be removed"); } if (!isAllAllowed()) { groups.remove(group); } }
/** * Remove group from the names of groups allowed for this service. * * @param group * The group name */ public void removeGroup(String group) { if (isWildCardACLValue(group)) { throw new IllegalArgumentException("Group " + group + " can not be removed"); } if (!isAllAllowed()) { groups.remove(group); } }
/** * Remove group from the names of groups allowed for this service. * * @param group * The group name */ public void removeGroup(String group) { if (isWildCardACLValue(group)) { throw new IllegalArgumentException("Group " + group + " can not be removed"); } if (!isAllAllowed()) { groups.remove(group); } }
/** * Remove group from the names of groups allowed for this service. * * @param group * The group name */ public void removeGroup(String group) { if (isWildCardACLValue(group)) { throw new IllegalArgumentException("Group " + group + " can not be removed"); } if (!isAllAllowed()) { groups.remove(group); } }
public void testWildCardAccessControlList() throws Exception { AccessControlList acl; acl = new AccessControlList("*"); assertTrue(acl.isAllAllowed()); acl = new AccessControlList(" * "); assertTrue(acl.isAllAllowed()); acl = new AccessControlList(" *"); assertTrue(acl.isAllAllowed()); acl = new AccessControlList("* "); assertTrue(acl.isAllAllowed()); }
@Test public void testWildCardAccessControlList() throws Exception { AccessControlList acl; acl = new AccessControlList("*"); assertTrue(acl.isAllAllowed()); acl = new AccessControlList(" * "); assertTrue(acl.isAllAllowed()); acl = new AccessControlList(" *"); assertTrue(acl.isAllAllowed()); acl = new AccessControlList("* "); assertTrue(acl.isAllAllowed()); }
@Test public void testWildCardAccessControlList() throws Exception { AccessControlList acl; acl = new AccessControlList("*"); assertTrue(acl.isAllAllowed()); acl = new AccessControlList(" * "); assertTrue(acl.isAllAllowed()); acl = new AccessControlList(" *"); assertTrue(acl.isAllAllowed()); acl = new AccessControlList("* "); assertTrue(acl.isAllAllowed()); }
private void assertAcl(final AccessControlList acl, final KeyOpType op, final String... names) { Assert.assertNotNull(acl); Assert.assertFalse(acl.isAllAllowed()); final Collection<String> actual = acl.getUsers(); final HashSet<String> expected = new HashSet<>(); for (String name : names) { expected.add(name); } Assert.assertEquals("defaultKeyAcls don't match for op:" + op, expected, actual); } }