Example #1
0
        private static void SetAces(Task.TaskVerboseLoggingDelegate verboseLogger, Task.TaskWarningLoggingDelegate warningLogger, Task.ErrorLoggerDelegate errorLogger, ADObject obj, bool remove, params ActiveDirectoryAccessRule[] aces)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }
            RawSecurityDescriptor rawSecurityDescriptor = obj.ReadSecurityDescriptor();

            rawSecurityDescriptor = DirectoryCommon.ApplyAcesOnSd(verboseLogger, warningLogger, errorLogger, obj.Id, rawSecurityDescriptor, remove, aces);
            if (rawSecurityDescriptor != null)
            {
                obj.SaveSecurityDescriptor(rawSecurityDescriptor);
            }
        }