// findACLValues() reads the entry to get it's ACL values
public static void findACLValues(LdapConnection lc, String entry)
{
String[] returnAttrs = { "acl" };
String attributeName;
IEnumerator allValues;
LdapAttribute attribute;
LdapAttributeSet attributeSet;
try
{
LdapEntry aclList = lc.Read( entry, returnAttrs );
// printout entryDN's ACL values
attributeSet = aclList.getAttributeSet();
IEnumerator allAttributes = attributeSet.GetEnumerator();
Console.WriteLine(" =========================================");
Console.WriteLine(" entryDN's ACL values after modification:");
Console.WriteLine(" =========================================");
if (allAttributes.MoveNext())
{
attribute = (LdapAttribute)allAttributes.Current;
attributeName = attribute.Name;
allValues = attribute.StringValues;
while(allValues.MoveNext())
{
PrintACLValue((String)allValues.Current);
}
}
}
catch( LdapException e )
{
Console.WriteLine( "Error: ModdifyACL, " + e.ToString() );
Environment.Exit(1);
}
}