Ejemplo n.º 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);
        }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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");
        }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 8
0
 public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, Guid objectType) : this(identity, ActiveDirectoryRightsTranslator.AccessMaskFromRights(adRights), auditFlags, objectType, false, 0, 0, Guid.Empty)
 {
 }
Ejemplo n.º 9
0
 public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, Guid objectType) : this(identity, ActiveDirectoryRightsTranslator.AccessMaskFromRights(adRights), type, objectType, false, 0, 0, Guid.Empty)
 {
 }