if (rolesToRemove == null)
{
throw new IllegalArgumentException("Argument rolesToRemove cannot be null");
}
Roles roles = rolesForComponentClass.get(componentClass);
if (roles != null)
{
roles.removeAll(rolesToRemove);
}
else
{
roles = new Roles();
rolesForComponentClass.put(componentClass, roles);
}
// If we removed the last authorized role, we authorize the empty role
// so that removing authorization can't suddenly open something up to
// everyone.
if (roles.size() == 0)
{
roles.add(MetaDataRoleAuthorizationStrategy.NO_ROLE);
}
}