public FileSystemAuditRule
				(String identity, FileSystemRights fileSystemRights,
				 InheritanceFlags inheritanceFlags,
				 PropagationFlags propagationFlags, AuditFlags auditFlags)
			: base(IdentityReference.IdentityFromName(identity),
				   (int)fileSystemRights, false, inheritanceFlags,
				   propagationFlags, auditFlags) {}
 public void AddAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
 {
     base.CheckAccessType(accessType);
     base.CheckFlags(inheritanceFlags, propagationFlags);
     this.everyOneFullAccessForNullDacl = false;
     base.AddQualifiedAce(sid, (accessType == AccessControlType.Allow) ? AceQualifier.AccessAllowed : AceQualifier.AccessDenied, accessMask, GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
 }
		public override sealed AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask,
								     bool isInherited, InheritanceFlags inheritanceFlags,
								     PropagationFlags propagationFlags, AccessControlType type)
		{
			return new FileSystemAccessRule (identityReference, (FileSystemRights) accessMask, isInherited,
							 inheritanceFlags, propagationFlags, type);
		}
	public RegistryAuditRule
				(String identity, RegistryRights registryRights,
				 InheritanceFlags inheritanceFlags,
				 PropagationFlags propagationFlags, AuditFlags auditFlags)
			: base(IdentityReference.IdentityFromName(identity),
				   (int)registryRights, false, inheritanceFlags,
				   propagationFlags, auditFlags) {}
Exemple #5
0
		protected AccessRule (IdentityReference identity,
				      int accessMask,
				      bool isInherited,
				      InheritanceFlags inheritanceFlags,
				      PropagationFlags propagationFlags,
				      AccessControlType type)
			: base (identity, accessMask, isInherited,
				inheritanceFlags, propagationFlags)
		{
			if (!(identity is SecurityIdentifier)) {
				throw new ArgumentException ("identity");
			}
			if (type < AccessControlType.Allow ||
			    type > AccessControlType.Deny) {
				throw new ArgumentException ("type");
			}
			
			
			if (accessMask == 0) {
				/* FIXME: check inheritance and
				 * propagation flags too
				 */
				throw new ArgumentOutOfRangeException ();
			}
		
			this.type = type;
		}
	public FileSystemAccessRule
				(String identity, FileSystemRights fileSystemRights,
				 InheritanceFlags inheritanceFlags,
				 PropagationFlags propagationFlags, AccessControlType type)
			: base(IdentityReference.IdentityFromName(identity),
				   (int)fileSystemRights, false, inheritanceFlags,
				   propagationFlags, type) {}
Exemple #7
0
		public override AccessRule AccessRuleFactory (IdentityReference identityReference,
							      int accessMask, bool isInherited,
							      InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags,
							      AccessControlType type)
		{
			return new PipeAccessRule (identityReference, (PipeAccessRights)accessMask, type);
		}
		internal static ActiveDirectorySecurityInheritance GetEffectiveInheritanceFlags(InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
		{
			ActiveDirectorySecurityInheritance activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.None;
			if ((inheritanceFlags & InheritanceFlags.ContainerInherit) != InheritanceFlags.None)
			{
				PropagationFlags propagationFlag = propagationFlags;
				if (propagationFlag == PropagationFlags.None)
				{
					activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.All;
					return activeDirectorySecurityInheritance;
				}
				else if (propagationFlag == PropagationFlags.NoPropagateInherit)
				{
					activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.SelfAndChildren;
					return activeDirectorySecurityInheritance;
				}
				else if (propagationFlag == PropagationFlags.InheritOnly)
				{
					activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.Descendents;
					return activeDirectorySecurityInheritance;
				}
				else if (propagationFlag == (PropagationFlags.NoPropagateInherit | PropagationFlags.InheritOnly))
				{
					activeDirectorySecurityInheritance = ActiveDirectorySecurityInheritance.Children;
					return activeDirectorySecurityInheritance;
				}
				throw new ArgumentException("propagationFlags");
			}
			return activeDirectorySecurityInheritance;
		}
Exemple #9
0
		protected internal AuthorizationRule (IdentityReference identity,
						      int accessMask, bool isInherited,
						      InheritanceFlags inheritanceFlags,
						      PropagationFlags propagationFlags)
		{
			if (!(identity is SecurityIdentifier) && !(identity is NTAccount))
				throw new ArgumentException ("identity");

			// Unit testing showed that MS.NET 4.0 actually throws ArgumentException
			// for accessMask == 0, not the ArgumentOutOfRangeException specified.			
			if (accessMask == 0)
				throw new ArgumentException ("accessMask");

			if (0 != (inheritanceFlags & ~(InheritanceFlags.ContainerInherit|InheritanceFlags.ObjectInherit)))
				throw new ArgumentOutOfRangeException ();

			if (0 != (propagationFlags & ~(PropagationFlags.NoPropagateInherit|PropagationFlags.InheritOnly)))
				throw new ArgumentOutOfRangeException ();
			
			this.identity = identity;
			this.accessMask = accessMask;
			this.isInherited = isInherited;
			this.inheritanceFlags = inheritanceFlags;
			this.propagationFlags = propagationFlags;
		}
Exemple #10
0
		public override sealed AuditRule AuditRuleFactory (IdentityReference identityReference,
								   int accessMask, bool isInherited,
								   InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags,
								   AuditFlags flags)
		{
			return new PipeAuditRule (identityReference, (PipeAccessRights)accessMask, flags);
		}
		internal QualifiedAce (InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AceQualifier aceQualifier, bool isCallback, byte [] opaque)
			: base (inheritanceFlags, propagationFlags)
		{
			ace_qualifier = aceQualifier;
			is_callback = isCallback;
			SetOpaque (opaque);
		}
        private static bool TestRemoveAudit(SystemAcl systemAcl, RawAcl rawAcl, AuditFlags auditFlag, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, bool removePossible)
        {
            bool result = true;
            bool isRemoved = false;
            byte[] sAclBinaryForm = null;
            byte[] rAclBinaryForm = null;
            isRemoved = systemAcl.RemoveAudit(auditFlag, sid, accessMask, inheritanceFlags, propagationFlags);
            if ((isRemoved == removePossible) &&
                (systemAcl.Count == rawAcl.Count) &&
                (systemAcl.BinaryLength == rawAcl.BinaryLength))
            {
                sAclBinaryForm = new byte[systemAcl.BinaryLength];
                rAclBinaryForm = new byte[rawAcl.BinaryLength];
                systemAcl.GetBinaryForm(sAclBinaryForm, 0);
                rawAcl.GetBinaryForm(rAclBinaryForm, 0);

                if (!Utils.IsBinaryFormEqual(sAclBinaryForm, rAclBinaryForm))
                    result = false;
                //redundant index check
                for (int i = 0; i < systemAcl.Count; i++)
                {
                    if (!Utils.IsAceEqual(systemAcl[i], rawAcl[i]))
                    {
                        result = false;
                        break;
                    }
                }
            }
            else
                result = false;
            return result;
        }
        private static bool TestAddAccess(DiscretionaryAcl discretionaryAcl, RawAcl rawAcl, AccessControlType accessControlType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
        {
            bool result = true;
            byte[] dAclBinaryForm = null;
            byte[] rAclBinaryForm = null;

            discretionaryAcl.AddAccess(accessControlType, sid, accessMask, inheritanceFlags, propagationFlags);
            if (discretionaryAcl.Count == rawAcl.Count &&
                discretionaryAcl.BinaryLength == rawAcl.BinaryLength)
            {

                dAclBinaryForm = new byte[discretionaryAcl.BinaryLength];
                rAclBinaryForm = new byte[rawAcl.BinaryLength];
                discretionaryAcl.GetBinaryForm(dAclBinaryForm, 0);
                rawAcl.GetBinaryForm(rAclBinaryForm, 0);
                if (!Utils.IsBinaryFormEqual(dAclBinaryForm, rAclBinaryForm))
                    result = false;

                //redundant index check

                for (int i = 0; i < discretionaryAcl.Count; i++)
                {
                    if (!Utils.IsAceEqual(discretionaryAcl[i], rawAcl[i]))
                    {

                        result = false;
                        break;
                    }
                }
            }
            else
                result = false;

            return result;
        }
	public RegistryAccessRule
				(String identity, RegistryRights registryRights,
				 InheritanceFlags inheritanceFlags,
				 PropagationFlags propagationFlags, AccessControlType type)
			: base(IdentityReference.IdentityFromName(identity),
				   (int)registryRights, false, inheritanceFlags,
				   propagationFlags, type) {}
		private static void AddDirectorySecurity(string folderName, string account, FileSystemRights rights, InheritanceFlags inheritance, PropagationFlags propogation, AccessControlType controlType)
		{
			DirectoryInfo directoryInfo = new DirectoryInfo(folderName);
			DirectorySecurity accessControl = directoryInfo.GetAccessControl();
			accessControl.AddAccessRule(new FileSystemAccessRule(account, rights, inheritance, propogation, controlType));
			directoryInfo.SetAccessControl(accessControl);
		}
		public virtual AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask,
							   bool isInherited, InheritanceFlags inheritanceFlags,
							   PropagationFlags propagationFlags, AuditFlags flags,
							   Guid objectType, Guid inheritedObjectType)
		{
			throw GetNotImplementedException ();
		}
		public FileSystemAccessRule (string identity,
					     FileSystemRights fileSystemRights,
					     InheritanceFlags inheritanceFlags,
					     PropagationFlags propagationFlags,
					     AccessControlType type)
			: this (new NTAccount (identity), fileSystemRights, inheritanceFlags, propagationFlags, type)
		{
		}
		public void AddAudit (AuditFlags auditFlags,
				      SecurityIdentifier sid, int accessMask,
				      InheritanceFlags inheritanceFlags,
				      PropagationFlags propagationFlags)
		{
			// CommonAce?
			throw new NotImplementedException ();
		}
		public bool RemoveAudit (AuditFlags auditFlags,
					 SecurityIdentifier sid,
					 int accessMask,
					 InheritanceFlags inheritanceFlags,
					 PropagationFlags propagationFlags)
		{
			throw new NotImplementedException ();
		}
		public bool RemoveAccess (AccessControlType accessType,
					  SecurityIdentifier sid,
					  int accessMask,
					  InheritanceFlags inheritanceFlags,
					  PropagationFlags propagationFlags)
		{
			throw new NotImplementedException ();
		}
			public TestRule (IdentityReference identity,
					int accessMask, bool isInherited,
					InheritanceFlags inheritanceFlags,
					PropagationFlags propagationFlags)
				: base (identity, accessMask, isInherited, inheritanceFlags, propagationFlags)
			{

			}
		public FileSystemAuditRule (IdentityReference identity,
					    FileSystemRights fileSystemRights,
					    InheritanceFlags inheritanceFlags,
					    PropagationFlags propagationFlags,
					    AuditFlags flags)
			: this (identity, fileSystemRights, false, inheritanceFlags, propagationFlags, flags)
		{
		}
 public void RemoveAuditSpecific(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
 {
     if (!base.IsDS)
     {
         throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_OnlyValidForDS"));
     }
     base.RemoveQualifiedAcesSpecific(sid, AceQualifier.SystemAudit, accessMask, (AceFlags) ((byte) (GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags))), objectFlags, objectType, inheritedObjectType);
 }
Exemple #24
0
		public FileSystemAuditRule (string identity,
					    FileSystemRights fileSystemRights,
					    InheritanceFlags inheritanceFlags,
					    PropagationFlags propagationFlags,
					    AuditFlags flags)
			: this (new SecurityIdentifier (identity), fileSystemRights, inheritanceFlags, propagationFlags, flags)
		{
		}
		public RegistryAccessRule (IdentityReference identity,
					   RegistryRights registryRights,
					   InheritanceFlags inheritanceFlags,
					   PropagationFlags propagationFlags,
					   AccessControlType type)
			: this (identity, registryRights, false, inheritanceFlags, propagationFlags, type)
		{
		}
	public void AddAudit(AuditFlags auditFlags, SecurityIdentifier sid,
						 int accessMask, InheritanceFlags inheritanceFlags,
						 PropagationFlags propagationFlags,
						 ObjectAceFlags objectFlags, Guid objectType,
						 Guid inheritedObjectType)
			{
				// TODO
			}
		public FileSystemAccessRule (IdentityReference identity,
					     FileSystemRights fileSystemRights,
					     InheritanceFlags inheritanceFlags,
					     PropagationFlags propagationFlags,
					     AccessControlType type)
			: this (identity, fileSystemRights, false, inheritanceFlags, propagationFlags, type)
		{
		}
Exemple #28
0
		public void AddAudit (AuditFlags auditFlags,
				      SecurityIdentifier sid, int accessMask,
				      InheritanceFlags inheritanceFlags,
				      PropagationFlags propagationFlags)
		{
			AddAce (AceQualifier.SystemAudit, sid, accessMask,
				inheritanceFlags, propagationFlags, auditFlags);
		}
		public RegistryAccessRule (string identity,
					   RegistryRights registryRights,
					   InheritanceFlags inheritanceFlags,
					   PropagationFlags propagationFlags,
					   AccessControlType type)
			: this (new NTAccount (identity), registryRights, inheritanceFlags, propagationFlags, type)
		{
		}
		public void AddAccess (AccessControlType accessType,
				       SecurityIdentifier sid, int accessMask,
				       InheritanceFlags inheritanceFlags,
				       PropagationFlags propagationFlags)
		{
			throw new NotImplementedException ();
			// CommonAce?
		}
 protected AccessRule_ForClousot2(object identity, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
     : base(identity, isInherited, inheritanceFlags, propagationFlags)
 {
     if ((inheritanceFlags < InheritanceFlags.None) ||
         (inheritanceFlags > (InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit)))
     {
         tmp = new object[1];
         throw new ArgumentOutOfRangeException();
     }
     if ((propagationFlags < PropagationFlags.None) ||
         (propagationFlags > (PropagationFlags.InheritOnly | PropagationFlags.NoPropagateInherit)))
     {
         tmp = new object[1];
         throw new ArgumentOutOfRangeException();
     }
 }
 public FileSystemAuditRule(string identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
 {
 }
 public override AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited,
                                            InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags, Guid objectType,
                                            Guid inheritedObjectType)
 {
     return(new CustomAuditRule(identityReference, accessMask, isInherited, inheritanceFlags, propagationFlags,
                                objectType, inheritedObjectType, flags));
 }
Exemple #34
0
 public virtual AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags, Guid objectType, Guid inheritedObjectType)
 {
     throw new NotImplementedException();
 }
Exemple #35
0
 public override AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
 {
     return(new EventWaitHandleAuditRule(identityReference, accessMask, isInherited, inheritanceFlags, propagationFlags, flags));
 }
 public override AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
 {
     throw new NotImplementedException();
 }
Exemple #37
0
 // Methods
 public virtual AccessRule AccessRuleFactory(System.Security.Principal.IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
 {
 }
Exemple #38
0
 /// <summary>用指定的值初始化 <see cref="T:System.Security.AccessControl.AuditRule" /> 类的新实例。</summary>
 /// <returns>此方法所创建的 <see cref="T:System.Security.AccessControl.AuditRule" /> 对象。</returns>
 /// <param name="identityReference">审核规则应用到的标识。它必须是可强制转换为 <see cref="T:System.Security.Principal.SecurityIdentifier" /> 的对象。</param>
 /// <param name="accessMask">此规则的访问掩码。访问掩码是一个 32 位的匿名位集合,其含义是由每个集成器定义的。</param>
 /// <param name="isInherited">如果此规则继承自父容器,则为 true。</param>
 /// <param name="inheritanceFlags">指定审核规则的继承属性。</param>
 /// <param name="propagationFlags">指定继承的审核规则是否自动传播。如果 <paramref name="inheritanceFlags" /> 设置为 <see cref="F:System.Security.AccessControl.InheritanceFlags.None" />,则将忽略传播标志。</param>
 /// <param name="flags">指定对规则进行审核的条件。</param>
 public override sealed AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
 {
     return((AuditRule) new CryptoKeyAuditRule(identityReference, CryptoKeyAuditRule.RightsFromAccessMask(accessMask), flags));
 }
Exemple #39
0
 /// <summary>用指定的值初始化 <see cref="T:System.Security.AccessControl.AccessRule" /> 类的新实例。</summary>
 /// <returns>此方法所创建的 <see cref="T:System.Security.AccessControl.AccessRule" /> 对象。</returns>
 /// <param name="identityReference">应用访问规则的标识。它必须是可强制转换为 <see cref="T:System.Security.Principal.SecurityIdentifier" /> 的对象。</param>
 /// <param name="accessMask">此规则的访问掩码。访问掩码是一个 32 位的匿名位集合,其含义是由每个集成器定义的。</param>
 /// <param name="isInherited">如果此规则继承自父容器,则为 true。</param>
 /// <param name="inheritanceFlags">指定访问规则的继承属性。</param>
 /// <param name="propagationFlags">指定继承的访问规则是否自动传播。如果 <paramref name="inheritanceFlags" /> 设置为 <see cref="F:System.Security.AccessControl.InheritanceFlags.None" />,则将忽略传播标志。</param>
 /// <param name="type">指定有效的访问控制类型。</param>
 public override sealed AccessRule AccessRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
 {
     return((AccessRule) new CryptoKeyAccessRule(identityReference, CryptoKeyAccessRule.RightsFromAccessMask(accessMask), type));
 }
Exemple #40
0
        /* // Not in the spec
         * public EventWaitHandleAuditRule(string identity, EventWaitHandleRights eventRights, AuditFlags flags)
         *  : this(new NTAccount(identity), (int) eventRights, false, InheritanceFlags.None, PropagationFlags.None, flags)
         * {
         * }
         */

        internal EventWaitHandleAuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
            : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, flags)
        {
        }
 public CustomAccessRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags
                         , PropagationFlags propagationFlags, AccessControlType type)
     : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, Guid.NewGuid(), Guid.NewGuid(), type)
 {
 }
Exemple #42
0
 public override AccessRule AccessRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
 {
     return(new EventWaitHandleAccessRule(identityReference, accessMask, isInherited, inheritanceFlags, propagationFlags, type));
 }
 protected internal AuthorizationRule(object identity, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
 {
     if ((inheritanceFlags < InheritanceFlags.None) ||
         (inheritanceFlags > (InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit)))
     {
         throw new ArgumentOutOfRangeException();
     }
     if ((propagationFlags < PropagationFlags.None) ||
         (propagationFlags > (PropagationFlags.InheritOnly | PropagationFlags.NoPropagateInherit)))
     {
         throw new ArgumentOutOfRangeException();
     }
 }
Exemple #44
0
 public override AccessRule AccessRuleFactory(IdentityReference identityReference,
                                              int accessMask, bool isInherited,
                                              InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags,
                                              AccessControlType type)
 {
     return(new PipeAccessRule(identityReference, (PipeAccessRights)accessMask, type));
 }
 public FileSystemAuditRule(System.Security.Principal.IdentityReference identity, FileSystemRights fileSystemRights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
 {
 }
Exemple #46
0
 public override sealed AuditRule AuditRuleFactory(IdentityReference identityReference,
                                                   int accessMask, bool isInherited,
                                                   InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags,
                                                   AuditFlags flags)
 {
     return(new PipeAuditRule(identityReference, (PipeAccessRights)accessMask, flags));
 }
 public CustomAuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags
                        , PropagationFlags propagationFlags, AuditFlags auditFlags)
     : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, Guid.NewGuid(), Guid.NewGuid(), auditFlags)
 {
 }
Exemple #48
0
 ///  <summary>
 ///  This member is not implemented.
 ///  </summary>
 ///  <param name="identityReference">
 ///         An <see cref="IdentityReference"/> object that represents a user account.
 ///  </param>
 ///  <param name="accessMask">
 ///         An integer that specifies an access type.
 ///  </param>
 ///  <param name="isInherited">
 ///         <strong>True</strong> if the access rule is inherited; otherwise, <strong>False</strong>. This parameter
 ///         is not used and is always set to <strong>False</strong>.
 ///  </param>
 ///  <param name="inheritanceFlags">
 ///         One of the <see cref="InheritanceFlags"/> values that specifies how to propagate access masks to child
 ///         objects. This parameter is not used and is always set to <strong>None</strong>.
 ///  </param>
 ///  <param name="propagationFlags">
 ///         One of the <see cref="PropagationFlags"/> values that specifies how to propagate Access Control Entries
 ///         (ACEs) to child objects. This parameter is not used and is always set to <strong>None</strong>.
 ///  </param>
 ///  <param name="flags">
 ///         One of the <see cref="AuditFlags"/> values that specifies the type of auditing to perform.
 ///  </param>
 /// <exception cref="NotSupportedException">The exception is thrown when the method is invoked.</exception>
 /// <returns>This method always throws exception.</returns>
 /// <remarks>This member is not implemented.</remarks>
 public override AuditRule AuditRuleFactory(IdentityReference identityReference, Int32 accessMask, Boolean isInherited,
                                            InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
 {
     //return new CertificationAuthorityAuditRule(identityReference, (CertificationAuthorityRights)accessMask, flags);
     throw new NotSupportedException(Error.E_AUDITNOTSUPPOERTED);
 }
Exemple #49
0
 public void SetAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
 {
     base.CheckFlags(inheritanceFlags, propagationFlags);
     base.SetQualifiedAce(sid, AceQualifier.SystemAudit, accessMask, (AceFlags)((byte)(GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags))), ObjectAceFlags.None, Guid.Empty, Guid.Empty);
 }
Exemple #50
0
 public void SetAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
 {
     if (!base.IsDS)
     {
         throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_OnlyValidForDS"));
     }
     base.CheckFlags(inheritanceFlags, propagationFlags);
     base.SetQualifiedAce(sid, AceQualifier.SystemAudit, accessMask, (AceFlags)((byte)(GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags))), objectFlags, objectType, inheritedObjectType);
 }
 public CustomAuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags,
                        PropagationFlags propagationFlags, Guid objectType, Guid inheritedObjectType, AuditFlags auditFlags)
     : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, objectType, inheritedObjectType, auditFlags)
 {
 }
 public override AccessRule AccessRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
 {
     throw new NotImplementedException();
 }
Exemple #53
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CertificationAuthorityAccessRule"/> class that represents a new access
 /// control rule for the specified user, with the specified access rights, access control, and flags.
 /// </summary>
 /// <param name="identityReference">
 ///		An <see cref="IdentityReference"/> object that represents a user account.
 /// </param>
 /// <param name="accessMask">
 ///		An integer that specifies an access type.
 /// </param>
 /// <param name="isInherited">
 ///		<strong>True</strong> if the access rule is inherited; otherwise, <strong>False</strong>. This parameter
 ///		is not used and is always set to <strong>False</strong>.
 /// </param>
 /// <param name="inheritanceFlags">
 ///		One of the <see cref="InheritanceFlags"/> values that specifies how to propagate access masks to child
 ///		objects. This parameter is not used and is always set to <strong>None</strong>.
 /// </param>
 /// <param name="propagationFlags">
 ///		One of the <see cref="PropagationFlags"/> values that specifies how to propagate Access Control Entries
 ///		(ACEs) to child objects. This parameter is not used and is always set to <strong>None</strong>.
 /// </param>
 /// <param name="type">
 ///		One of the <see cref="AccessControlType"/> values that specifies whether access is allowed or denied.
 /// </param>
 /// <returns>
 ///		A new <see cref="CertificationAuthorityAccessRule"/> object that represents a new access control rule
 ///		for the specified user, with the specified access rights, access control, and flags.
 /// </returns>
 public override AccessRule AccessRuleFactory(IdentityReference identityReference, Int32 accessMask, Boolean isInherited,
                                              InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
 {
     return(new CertificationAuthorityAccessRule(identityReference, (CertificationAuthorityRights)accessMask, type));
 }
Exemple #54
0
 public void AddAccess(AccessControlType accessType, SecurityIdentifier sid,
                       int accessMask, InheritanceFlags inheritanceFlags,
                       PropagationFlags propagationFlags)
 {
     // TODO
 }
 public AuditRule(string identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(InheritanceFlags), default(PropagationFlags), default(AuditFlags))
 {
     Contract.Ensures(0 <= identity.Length);
     Contract.Ensures(identity.Length <= 512);
 }
Exemple #56
0
        protected ObjectAuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid objectType, Guid inheritedObjectType, AuditFlags auditFlags)
            : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, auditFlags)
        {
            if ((!objectType.Equals(Guid.Empty)) && ((accessMask & ObjectAce.AccessMaskWithObjectType) != 0))
            {
                _objectType   = objectType;
                _objectFlags |= ObjectAceFlags.ObjectAceTypePresent;
            }
            else
            {
                _objectType = Guid.Empty;
            }

            if ((!inheritedObjectType.Equals(Guid.Empty)) && ((inheritanceFlags & InheritanceFlags.ContainerInherit) != 0))
            {
                _inheritedObjectType = inheritedObjectType;
                _objectFlags        |= ObjectAceFlags.InheritedObjectAceTypePresent;
            }
            else
            {
                _inheritedObjectType = Guid.Empty;
            }
        }
 public AuditRule(System.Security.Principal.IdentityReference identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(InheritanceFlags), default(PropagationFlags), default(AuditFlags))
 {
 }
Exemple #58
0
 public bool RemoveAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
 {
     return(base.RemoveQualifiedAces(sid, AceQualifier.SystemAudit, accessMask, (AceFlags)((byte)(GenericAce.AceFlagsFromAuditFlags(auditFlags) | GenericAce.AceFlagsFromInheritanceFlags(inheritanceFlags, propagationFlags))), true, ObjectAceFlags.None, Guid.Empty, Guid.Empty));
 }
Exemple #59
0
 public virtual AuditRule AuditRuleFactory(System.Security.Principal.IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
 {
 }
Exemple #60
0
 public AccessRule(System.Security.Principal.IdentityReference identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type) : base(default(System.Security.Principal.IdentityReference), default(int), default(bool), default(InheritanceFlags), default(PropagationFlags), default(AccessControlType))
 {
 }