示例#1
0
        internal static int AccessMaskFromPropertyAccess(PropertyAccess access)
        {
            int accessMask = 0;

            if (access < PropertyAccess.Read || access > PropertyAccess.Write)
            {
                throw new InvalidEnumArgumentException("access", (int)access, typeof(PropertyAccess));
            }

            switch (access)
            {
            case PropertyAccess.Read:
            {
                accessMask = ActiveDirectoryRightsTranslator.AccessMaskFromRights(ActiveDirectoryRights.ReadProperty);
                break;
            }

            case PropertyAccess.Write:
            {
                accessMask = ActiveDirectoryRightsTranslator.AccessMaskFromRights(ActiveDirectoryRights.WriteProperty);
                break;
            }

            default:

                //
                // This should not happen. Indicates a problem with the
                // internal logic.
                //
                Debug.Fail("Invalid PropertyAccess value");
                throw new ArgumentException("access");
            }
            return(accessMask);
        }
示例#2
0
 public ActiveDirectoryAccessRule(
     IdentityReference identity,
     ActiveDirectoryRights adRights,
     AccessControlType type,
     ActiveDirectorySecurityInheritance inheritanceType)
     : this(
         identity,
         ActiveDirectoryRightsTranslator.AccessMaskFromRights(adRights),
         type,
         Guid.Empty,
         false,
         ActiveDirectoryInheritanceTranslator.GetInheritanceFlags(inheritanceType),
         ActiveDirectoryInheritanceTranslator.GetPropagationFlags(inheritanceType),
         Guid.Empty)
 {
 }
示例#3
0
 public ActiveDirectoryAccessRule(
     IdentityReference identity,
     ActiveDirectoryRights adRights,
     AccessControlType type,
     Guid objectType)
     : this(
         identity,
         ActiveDirectoryRightsTranslator.AccessMaskFromRights(adRights),
         type,
         objectType,
         false,
         InheritanceFlags.None,
         PropagationFlags.None,
         Guid.Empty)
 {
 }
示例#4
0
 public ActiveDirectoryAuditRule(
     IdentityReference identity,
     ActiveDirectoryRights adRights,
     AuditFlags auditFlags)
     : this(
         identity,
         ActiveDirectoryRightsTranslator.AccessMaskFromRights(adRights),
         auditFlags,
         Guid.Empty,
         false,
         InheritanceFlags.None,
         PropagationFlags.None,
         Guid.Empty
         )
 {
 }
        internal static int AccessMaskFromPropertyAccess(PropertyAccess access)
        {
            if ((access < PropertyAccess.Read) || (access > PropertyAccess.Write))
            {
                throw new InvalidEnumArgumentException("access", (int)access, typeof(PropertyAccess));
            }
            switch (access)
            {
            case PropertyAccess.Read:
                return(ActiveDirectoryRightsTranslator.AccessMaskFromRights(ActiveDirectoryRights.ReadProperty));

            case PropertyAccess.Write:
                return(ActiveDirectoryRightsTranslator.AccessMaskFromRights(ActiveDirectoryRights.WriteProperty));
            }
            throw new ArgumentException("access");
        }
示例#6
0
 public ActiveDirectoryAuditRule(
     IdentityReference identity,
     ActiveDirectoryRights adRights,
     AuditFlags auditFlags,
     ActiveDirectorySecurityInheritance inheritanceType,
     Guid inheritedObjectType)
     : this(
         identity,
         ActiveDirectoryRightsTranslator.AccessMaskFromRights(adRights),
         auditFlags,
         Guid.Empty,
         false,
         ActiveDirectoryInheritanceTranslator.GetInheritanceFlags(inheritanceType),
         ActiveDirectoryInheritanceTranslator.GetPropagationFlags(inheritanceType),
         inheritedObjectType)
 {
 }
示例#7
0
 public ActiveDirectoryAccessRule(IdentityReference identity, System.DirectoryServices.ActiveDirectoryRights adRights, AccessControlType type, Guid objectType, ActiveDirectorySecurityInheritance inheritanceType, Guid inheritedObjectType) : this(identity, ActiveDirectoryRightsTranslator.AccessMaskFromRights(adRights), type, objectType, false, ActiveDirectoryInheritanceTranslator.GetInheritanceFlags(inheritanceType), ActiveDirectoryInheritanceTranslator.GetPropagationFlags(inheritanceType), inheritedObjectType)
 {
 }
 public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, Guid objectType) : this(identity, ActiveDirectoryRightsTranslator.AccessMaskFromRights(adRights), auditFlags, objectType, false, 0, 0, Guid.Empty)
 {
 }
示例#9
0
 public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, Guid objectType) : this(identity, ActiveDirectoryRightsTranslator.AccessMaskFromRights(adRights), type, objectType, false, 0, 0, Guid.Empty)
 {
 }