Inheritance: AuthorizationRule
コード例 #1
0
ファイル: ObjectSecurity.cs プロジェクト: rsumner31/corefx2
        public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            if (rule == null)
            {
                throw new ArgumentNullException(nameof(rule));
            }

            if (!this.AuditRuleType.GetTypeInfo().IsAssignableFrom(rule.GetType().GetTypeInfo()))
            {
                throw new ArgumentException(
                          SR.AccessControl_InvalidAuditRuleType,
                          nameof(rule));
            }

            WriteLock();

            try
            {
                return(ModifyAudit(modification, rule, out modified));
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #2
0
        public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }

            if (!this.AuditRuleType.IsAssignableFrom(rule.GetType()))
            {
                throw new ArgumentException(
                          Environment.GetResourceString("AccessControl_InvalidAuditRuleType"),
                          "rule");
            }
            Contract.EndContractBlock();

            WriteLock();

            try
            {
                return(ModifyAudit(modification, rule, out modified));
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #3
0
 /// <summary>将指定修改应用于与此 <see cref="T:System.Security.AccessControl.DirectoryObjectSecurity" /> 对象关联的系统访问控制列表 (SACL)。</summary>
 /// <returns>如果成功修改了 SACL,则为 true;否则为 false。</returns>
 /// <param name="modification">要应用于 SACL 的修改。</param>
 /// <param name="rule">要修改的审核规则。</param>
 /// <param name="modified">如果成功修改了 SACL,则为 true;否则为 false。</param>
 protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
 {
     if (!this.AuditRuleType.IsAssignableFrom(rule.GetType()))
     {
         throw new ArgumentException(Environment.GetResourceString("AccessControl_InvalidAuditRuleType"), "rule");
     }
     return(this.ModifyAudit(modification, rule as ObjectAuditRule, out modified));
 }
コード例 #4
0
 protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
 {
     //if (this.AccessRuleType.IsAssignableFrom(rule.GetType().GetTypeInfo()))
     ////if (!TypeExtensions.IsAssignableFrom(this.AuditRuleType, rule.GetType()))
     //{
     //    throw new ArgumentException(
     //        SR.AccessControl_InvalidAuditRuleType,
     //        "rule");
     //}
     return(ModifyAudit(modification, rule as ObjectAuditRule, out modified));
 }
コード例 #5
0
        public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }

            if (!AuditRuleType.IsAssignableFrom(rule.GetType()))
            {
                throw new ArgumentException("rule");
            }

            return(ModifyAudit(modification, rule, out modified));
        }
 protected void AddAuditRule(AuditRule rule)
 {
     if (rule == null)
     {
         throw new ArgumentNullException("rule");
     }
     base.WriteLock();
     try
     {
         bool flag;
         this.ModifyAudit(AccessControlModification.Add, rule, out flag);
     }
     finally
     {
         base.WriteUnlock();
     }
 }
コード例 #7
0
 protected void AddAuditRule(AuditRule rule)
 {
     if (rule == null)
     {
         throw new ArgumentNullException("rule");
     }
     base.WriteLock();
     try
     {
         bool flag;
         this.ModifyAudit(AccessControlModification.Add, rule, out flag);
     }
     finally
     {
         base.WriteUnlock();
     }
 }
コード例 #8
0
 /// <summary>从与此 <see cref="T:System.Security.AccessControl.CommonObjectSecurity" /> 对象关联的系统访问控制列表 (SACL) 中移除与指定的审核规则完全匹配的所有审核规则。</summary>
 /// <param name="rule">要移除的审核规则。</param>
 protected void RemoveAuditRuleSpecific(AuditRule rule)
 {
     if (rule == null)
     {
         throw new ArgumentNullException("rule");
     }
     this.WriteLock();
     try
     {
         bool modified;
         this.ModifyAudit(AccessControlModification.RemoveSpecific, rule, out modified);
     }
     finally
     {
         this.WriteUnlock();
     }
 }
コード例 #9
0
        protected void RemoveAuditRuleAll(AuditRule rule)
        {
            if (rule == null)
            {
                throw new ArgumentNullException(nameof(rule));
            }

            WriteLock();

            try
            {
                bool modified;
                ModifyAudit(AccessControlModification.RemoveAll, rule, out modified);
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #10
0
        protected bool RemoveAuditRule(AuditRule rule)
        {
            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }
            Contract.EndContractBlock();

            WriteLock();

            try
            {
                bool modified;
                return(ModifyAudit(AccessControlModification.Remove, rule, out modified));
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #11
0
        protected void SetAuditRule(AuditRule rule)
        {
            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }
            Contract.EndContractBlock();

            WriteLock();

            try
            {
                bool modified;
                ModifyAudit(AccessControlModification.Set, rule, out modified);
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #12
0
        protected bool RemoveAuditRule(AuditRule rule)
        {
            bool flag2;

            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }
            base.WriteLock();
            try
            {
                bool flag;
                flag2 = this.ModifyAudit(AccessControlModification.Remove, rule, out flag);
            }
            finally
            {
                base.WriteUnlock();
            }
            return(flag2);
        }
コード例 #13
0
        internal AuthorizationRuleCollection InternalGetAuditRules(bool includeExplicit,
                                                                   bool includeInherited,
                                                                   Type targetType)
        {
            List <AuthorizationRule> rules = new List <AuthorizationRule> ();

            ReadLock();
            try {
                if (null != descriptor.SystemAcl)
                {
                    foreach (GenericAce genericAce in descriptor.SystemAcl)
                    {
                        QualifiedAce ace = genericAce as QualifiedAce;
                        if (null == ace)
                        {
                            continue;
                        }
                        if (ace.IsInherited && !includeInherited)
                        {
                            continue;
                        }
                        if (!ace.IsInherited && !includeExplicit)
                        {
                            continue;
                        }

                        if (AceQualifier.SystemAudit != ace.AceQualifier)
                        {
                            continue;
                        }

                        AuditRule rule = InternalAuditRuleFactory(ace, targetType);
                        rules.Add(rule);
                    }
                }
            } finally {
                ReadUnlock();
            }

            return(new AuthorizationRuleCollection(rules.ToArray()));
        }
コード例 #14
0
        protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            foreach (AuditRule r in audit_rules)
            {
                if (rule != r)
                {
                    continue;
                }
                switch (modification)
                {
                case AccessControlModification.Add:
                    AddAuditRule(rule);
                    break;

                case AccessControlModification.Set:
                    SetAuditRule(rule);
                    break;

                //case AccessControlModification.Reset:
                //	ResetAuditRule (rule);
                //	break;
                case AccessControlModification.Remove:
                    RemoveAuditRule(rule);
                    break;

                case AccessControlModification.RemoveAll:
                    RemoveAuditRuleAll(rule);
                    break;

                case AccessControlModification.RemoveSpecific:
                    RemoveAuditRuleSpecific(rule);
                    break;
                }
                AuditRulesModified = true;
                modified           = true;
                return(true);
            }
            modified = false;
            return(false);
        }
コード例 #15
0
        /// <summary>Applies the specified modification to the System Access Control List (SACL) associated with this <see cref="T:System.Security.AccessControl.CommonObjectSecurity" /> object.</summary>
        /// <returns>true if the SACL is successfully modified; otherwise, false.</returns>
        /// <param name="modification">The modification to apply to the SACL.</param>
        /// <param name="rule">The audit rule to modify.</param>
        /// <param name="modified">true if the SACL is successfully modified; otherwise, false.</param>
        protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            foreach (AuditRule auditRule in this.audit_rules)
            {
                if (rule == auditRule)
                {
                    switch (modification)
                    {
                    case AccessControlModification.Add:
                        this.AddAuditRule(rule);
                        break;

                    case AccessControlModification.Set:
                        this.SetAuditRule(rule);
                        break;

                    case AccessControlModification.Remove:
                        this.RemoveAuditRule(rule);
                        break;

                    case AccessControlModification.RemoveAll:
                        this.RemoveAuditRuleAll(rule);
                        break;

                    case AccessControlModification.RemoveSpecific:
                        this.RemoveAuditRuleSpecific(rule);
                        break;
                    }
                    base.AuditRulesModified = true;
                    modified = true;
                    return(true);
                }
            }
            modified = false;
            return(false);
        }
コード例 #16
0
ファイル: CommonObjectSecurity.cs プロジェクト: runefs/Marvin
		protected void SetAuditRule (AuditRule rule)
		{
			throw new NotImplementedException ();
		}
コード例 #17
0
ファイル: CommonObjectSecurity.cs プロジェクト: runefs/Marvin
		protected bool RemoveAuditRule (AuditRule rule)
		{
			throw new NotImplementedException ();
		}
コード例 #18
0
 protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
 {
     if ( !this.AuditRuleType.IsAssignableFrom(rule.GetType()) )
     {
         throw new ArgumentException(
             Environment.GetResourceString("AccessControl_InvalidAuditRuleType"), 
             "rule");
     }
     Contract.EndContractBlock();
     return ModifyAudit(modification, rule as ObjectAuditRule, out modified);
 }
コード例 #19
0
        //
        // Modifies the SACL
        //

        protected override bool ModifyAudit( AccessControlModification modification, AuditRule rule, out bool modified )
        {
            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }
            Contract.EndContractBlock();

            WriteLock();
            try
            {
                bool result = true;

                if ( _securityDescriptor.SystemAcl == null )
                {
                    if ( modification == AccessControlModification.Remove || 
                        modification == AccessControlModification.RemoveAll ||
                        modification == AccessControlModification.RemoveSpecific )
                    {
                        modified = false;
                        return result;
                    }

                    _securityDescriptor.SystemAcl = new SystemAcl( IsContainer, IsDS, GenericAcl.AclRevision, 1 );
                    _securityDescriptor.AddControlFlags(ControlFlags.SystemAclPresent);
                }

                SecurityIdentifier sid = rule.IdentityReference.Translate( typeof( SecurityIdentifier )) as SecurityIdentifier;

                switch ( modification )
                {
                    case AccessControlModification.Add :
                        _securityDescriptor.SystemAcl.AddAudit( rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags );
                        break;

                    case AccessControlModification.Set :
                        _securityDescriptor.SystemAcl.SetAudit( rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags );
                        break;

                    case AccessControlModification.Reset :
                        _securityDescriptor.SystemAcl.SetAudit( rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags );
                        break;

                    case AccessControlModification.Remove :
                        result = _securityDescriptor.SystemAcl.RemoveAudit( rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags );
                        break;

                    case AccessControlModification.RemoveAll :
                        result = _securityDescriptor.SystemAcl.RemoveAudit( AuditFlags.Failure | AuditFlags.Success, sid, -1, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, 0 );
                        if ( result == false )
                        {
                            throw new InvalidProgramException();
                        }

                        break;

                    case AccessControlModification.RemoveSpecific :
                        _securityDescriptor.SystemAcl.RemoveAuditSpecific(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags );
                        break;

                    default :
                        throw new ArgumentOutOfRangeException(
                            "modification",
                            Environment.GetResourceString( "ArgumentOutOfRange_Enum" ));
                }

                modified = result;
                AuditRulesModified |= modified;
                return result;
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #20
0
 public virtual void RemoveAuditRuleSpecific(AuditRule <T> rule)
 {
     throw new NotImplementedException();
 }
コード例 #21
0
ファイル: ObjectSecurityT.cs プロジェクト: rsumner31/corefx2
 public virtual void RemoveAuditRuleSpecific(AuditRule <T> rule)
 {
     base.RemoveAuditRuleSpecific(rule);
 }
 protected void AddAuditRule(AuditRule rule)
 {
 }
コード例 #23
0
        public override bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            if (!SaclRetrieved())
            {
                throw new InvalidOperationException(Res.GetString(Res.CannotModifySacl));
            }

            return base.ModifyAuditRule(modification, rule, out modified);
        }
コード例 #24
0
		protected override bool ModifyAudit (AccessControlModification modification, AuditRule rule, out bool modified)
		{
			if (null == rule)
				throw new ArgumentNullException ("rule");

			modified = true;
			
			WriteLock ();
			try {
				switch (modification) {
				case AccessControlModification.Add:
					if (null == descriptor.SystemAcl)
						descriptor.SystemAcl = new SystemAcl (IsContainer, IsDS, 1);
					
					descriptor.SystemAcl.AddAudit (rule.AuditFlags,
								       SidFromIR (rule.IdentityReference),
								       rule.AccessMask,
								       rule.InheritanceFlags,
								       rule.PropagationFlags);
					break;
				case AccessControlModification.Set:
					if (null == descriptor.SystemAcl)
						descriptor.SystemAcl = new SystemAcl (IsContainer, IsDS, 1);

					descriptor.SystemAcl.SetAudit (rule.AuditFlags,
								       SidFromIR (rule.IdentityReference),
								       rule.AccessMask,
								       rule.InheritanceFlags,
								       rule.PropagationFlags);
					break;
				case AccessControlModification.Reset:
					break;
				case AccessControlModification.Remove:
					if (null == descriptor.SystemAcl)
						modified = false;
					else
						modified = descriptor.SystemAcl.RemoveAudit (rule.AuditFlags,
											     SidFromIR (rule.IdentityReference),
											     rule.AccessMask,
											     rule.InheritanceFlags,
											     rule.PropagationFlags);
					break;
				case AccessControlModification.RemoveAll:
					PurgeAuditRules (rule.IdentityReference);
					break;
				case AccessControlModification.RemoveSpecific:
					if (null != descriptor.SystemAcl)
						descriptor.SystemAcl.RemoveAuditSpecific (rule.AuditFlags,
											  SidFromIR (rule.IdentityReference),
											  rule.AccessMask,
											  rule.InheritanceFlags,
											  rule.PropagationFlags);
					break;
				default:
					throw new ArgumentOutOfRangeException ("modification");
				}
				
				if (modified) AuditRulesModified = true;
			} finally {
				WriteUnlock ();
			}
			
			return modified;
		}
コード例 #25
0
		protected void SetAuditRule (AuditRule rule)
		{
			bool modified;
			ModifyAudit (AccessControlModification.Set, rule, out modified);
		}
コード例 #26
0
 /// <summary>Removes all audit rules that contain the same security identifier and qualifier as the specified audit rule in the System Access Control List (SACL) associated with this <see cref="T:System.Security.AccessControl.CommonObjectSecurity" /> object and then adds the specified audit rule.</summary><param name="rule">The audit rule to set.</param>
 protected void SetAuditRule(AuditRule rule)
 {
     throw new NotImplementedException();
 }
コード例 #27
0
		protected void RemoveAuditRuleSpecific (AuditRule rule)
		{
			bool modified;
			ModifyAudit (AccessControlModification.RemoveSpecific, rule, out modified);
		}
    public virtual new bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified)
    {
      Contract.Requires(this.AuditRuleType != null);

      modified = default(bool);

      return default(bool);
    }
コード例 #29
0
ファイル: ObjectSecurity.cs プロジェクト: PlumpMath/CIL2Java
 public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, ref bool modified)
 {
     throw new NotImplementedException();
 }
    protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
    {
      modified = default(bool);

      return default(bool);
    }
コード例 #31
0
 public virtual bool RemoveAuditRule(AuditRule <T> rule)
 {
     throw new NotImplementedException();
 }
コード例 #32
0
        protected bool RemoveAuditRule(AuditRule rule)
        {
            if (rule == null)
            {
                throw new ArgumentNullException(nameof(rule));
            }
            Contract.EndContractBlock();

            WriteLock();

            try
            {
                bool modified;
                return ModifyAudit(AccessControlModification.Remove, rule, out modified);
            }
            finally
            {
                WriteUnlock();
            }
        }
 protected bool RemoveAuditRule(AuditRule rule)
 {
     bool flag2;
     if (rule == null)
     {
         throw new ArgumentNullException("rule");
     }
     base.WriteLock();
     try
     {
         bool flag;
         flag2 = this.ModifyAudit(AccessControlModification.Remove, rule, out flag);
     }
     finally
     {
         base.WriteUnlock();
     }
     return flag2;
 }
コード例 #34
0
			protected override bool ModifyAudit (AccessControlModification modification,
			                                     AuditRule rule, out bool modified)
			{
				modified = false; return modified;
			}
コード例 #35
0
        protected void RemoveAuditRuleSpecific( AuditRule rule )
        {
            if ( rule == null )
            {
                throw new ArgumentNullException( "rule" );
            }
            Contract.EndContractBlock();

            WriteLock();

            try
            {
                bool modified;
                ModifyAudit( AccessControlModification.RemoveSpecific, rule, out modified );
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #36
0
 /// <summary>Removes all audit rules that exactly match the specified audit rule from the System Access Control List (SACL) associated with this <see cref="T:System.Security.AccessControl.CommonObjectSecurity" /> object.</summary><param name="rule">The audit rule to remove.</param>
 protected void RemoveAuditRuleSpecific(AuditRule rule)
 {
     throw new NotImplementedException();
 }
コード例 #37
0
ファイル: CommonObjectSecurity.cs プロジェクト: runefs/Marvin
		// Audit
		
		protected void AddAuditRule (AuditRule rule)
		{
			audit_rules.Add (rule);
			AuditRulesModified = true;
		}
コード例 #38
0
        //
        // Modifies the SACL
        //

        protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }
            Contract.EndContractBlock();

            WriteLock();
            try
            {
                bool result = true;

                if (_securityDescriptor.SystemAcl == null)
                {
                    if (modification == AccessControlModification.Remove ||
                        modification == AccessControlModification.RemoveAll ||
                        modification == AccessControlModification.RemoveSpecific)
                    {
                        modified = false;
                        return(result);
                    }

                    _securityDescriptor.SystemAcl = new SystemAcl(IsContainer, IsDS, GenericAcl.AclRevision, 1);
                    _securityDescriptor.AddControlFlags(ControlFlags.SystemAclPresent);
                }

                SecurityIdentifier sid = rule.IdentityReference.Translate(typeof(SecurityIdentifier)) as SecurityIdentifier;

                switch (modification)
                {
                case AccessControlModification.Add:
                    _securityDescriptor.SystemAcl.AddAudit(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                    break;

                case AccessControlModification.Set:
                    _securityDescriptor.SystemAcl.SetAudit(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                    break;

                case AccessControlModification.Reset:
                    _securityDescriptor.SystemAcl.SetAudit(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                    break;

                case AccessControlModification.Remove:
                    result = _securityDescriptor.SystemAcl.RemoveAudit(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                    break;

                case AccessControlModification.RemoveAll:
                    result = _securityDescriptor.SystemAcl.RemoveAudit(AuditFlags.Failure | AuditFlags.Success, sid, -1, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, 0);
                    if (result == false)
                    {
                        throw new InvalidOperationException();
                    }

                    break;

                case AccessControlModification.RemoveSpecific:
                    _securityDescriptor.SystemAcl.RemoveAuditSpecific(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(
                              "modification",
                              SR.ArgumentOutOfRange_Enum);
                }

                modified            = result;
                AuditRulesModified |= modified;
                return(result);
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #39
0
ファイル: CommonObjectSecurity.cs プロジェクト: runefs/Marvin
		protected void RemoveAuditRuleSpecific (AuditRule rule)
		{
			throw new NotImplementedException ();
		}
        protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            bool flag2;
            if (rule == null)
            {
                throw new ArgumentNullException("rule");
            }
            base.WriteLock();
            try
            {
                bool flag = true;
                if (base._securityDescriptor.SystemAcl == null)
                {
                    if (((modification == AccessControlModification.Remove) || (modification == AccessControlModification.RemoveAll)) || (modification == AccessControlModification.RemoveSpecific))
                    {
                        modified = false;
                        return flag;
                    }
                    base._securityDescriptor.SystemAcl = new SystemAcl(base.IsContainer, base.IsDS, GenericAcl.AclRevision, 1);
                    base._securityDescriptor.AddControlFlags(ControlFlags.SystemAclPresent);
                }
                SecurityIdentifier sid = rule.IdentityReference.Translate(typeof(SecurityIdentifier)) as SecurityIdentifier;
                switch (modification)
                {
                    case AccessControlModification.Add:
                        base._securityDescriptor.SystemAcl.AddAudit(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                        break;

                    case AccessControlModification.Set:
                        base._securityDescriptor.SystemAcl.SetAudit(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                        break;

                    case AccessControlModification.Reset:
                        base._securityDescriptor.SystemAcl.SetAudit(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                        break;

                    case AccessControlModification.Remove:
                        flag = base._securityDescriptor.SystemAcl.RemoveAudit(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                        break;

                    case AccessControlModification.RemoveAll:
                        flag = base._securityDescriptor.SystemAcl.RemoveAudit(AuditFlags.Failure | AuditFlags.Success, sid, -1, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.None);
                        if (!flag)
                        {
                            throw new InvalidProgramException();
                        }
                        break;

                    case AccessControlModification.RemoveSpecific:
                        base._securityDescriptor.SystemAcl.RemoveAuditSpecific(rule.AuditFlags, sid, rule.AccessMask, rule.InheritanceFlags, rule.PropagationFlags);
                        break;

                    default:
                        throw new ArgumentOutOfRangeException("modification", Environment.GetResourceString("ArgumentOutOfRange_Enum"));
                }
                modified = flag;
                base.AuditRulesModified |= modified;
                flag2 = flag;
            }
            finally
            {
                base.WriteUnlock();
            }
            return flag2;
        }
コード例 #41
0
ファイル: CommonObjectSecurity.cs プロジェクト: runefs/Marvin
		protected override bool ModifyAudit (AccessControlModification modification, AuditRule rule, out bool modified)
		{
			foreach (AuditRule r in audit_rules) {
				if (rule != r)
					continue;
				switch (modification) {
				case AccessControlModification.Add:
					AddAuditRule (rule);
					break;
				case AccessControlModification.Set:
					SetAuditRule (rule);
					break;
				//case AccessControlModification.Reset:
				//	ResetAuditRule (rule);
				//	break;
				case AccessControlModification.Remove:
					RemoveAuditRule (rule);
					break;
				case AccessControlModification.RemoveAll:
					RemoveAuditRuleAll (rule);
					break;
				case AccessControlModification.RemoveSpecific:
					RemoveAuditRuleSpecific (rule);
					break;
				}
				AuditRulesModified = true;
				modified = true;
				return true;
			}
			modified = false;
			return false;
		}
コード例 #42
0
ファイル: ObjectSecurityT.cs プロジェクト: rsumner31/corefx2
 public virtual bool RemoveAuditRule(AuditRule <T> rule)
 {
     return(base.RemoveAuditRule(rule));
 }
コード例 #43
0
 /// <summary>Removes audit rules that contain the same security identifier and access mask as the specified audit rule from the System Access Control List (SACL) associated with this <see cref="T:System.Security.AccessControl.CommonObjectSecurity" /> object.</summary><returns>true if the audit rule was successfully removed; otherwise, false.</returns><param name="rule">The audit rule to remove.</param>
 protected bool RemoveAuditRule(AuditRule rule)
 {
     throw new NotImplementedException();
 }
コード例 #44
0
		protected bool RemoveAuditRule (AuditRule rule)
		{
			bool modified;
			return ModifyAudit (AccessControlModification.Remove, rule, out modified);
		}
コード例 #45
0
ファイル: objectsecurity.cs プロジェクト: REALTOBIZ/mono
        public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            if ( rule == null )
            {
                throw new ArgumentNullException( "rule" );
            }

            if ( !this.AuditRuleType.IsAssignableFrom(rule.GetType()) )
            {
                throw new ArgumentException(
                    Environment.GetResourceString("AccessControl_InvalidAuditRuleType"), 
                    "rule");
            }
            Contract.EndContractBlock();

            WriteLock();

            try
            {
                return ModifyAudit(modification, rule, out modified);
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #46
0
ファイル: ObjectSecurity.cs プロジェクト: ChuangYang/corefx
 protected abstract bool ModifyAudit( AccessControlModification modification, AuditRule rule, out bool modified );
コード例 #47
0
ファイル: ObjectSecurityT.cs プロジェクト: rsumner31/corefx2
 public virtual void AddAuditRule(AuditRule <T> rule)
 {
     base.AddAuditRule(rule);
 }
 protected bool RemoveAuditRule(AuditRule rule)
 {
   return default(bool);
 }
コード例 #49
0
 protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
 {
     //if (this.AccessRuleType.IsAssignableFrom(rule.GetType().GetTypeInfo()))
     ////if (!TypeExtensions.IsAssignableFrom(this.AuditRuleType, rule.GetType()))
     //{
     //    throw new ArgumentException(
     //        SR.AccessControl_InvalidAuditRuleType,
     //        "rule");
     //}
     Contract.EndContractBlock();
     return ModifyAudit(modification, rule as ObjectAuditRule, out modified);
 }
コード例 #50
0
		public virtual bool ModifyAuditRule (AccessControlModification modification, AuditRule rule, out bool modified)
		{
			throw new NotImplementedException ();
		}
コード例 #51
0
ファイル: ObjectSecurity.cs プロジェクト: ChuangYang/corefx
        public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified)
        {
            if ( rule == null )
            {
                throw new ArgumentNullException( nameof(rule));
            }

            if ( !this.AuditRuleType.GetTypeInfo().IsAssignableFrom(rule.GetType().GetTypeInfo()) )
            {
                throw new ArgumentException(
                    SR.AccessControl_InvalidAuditRuleType, 
nameof(rule));
            }
            Contract.EndContractBlock();

            WriteLock();

            try
            {
                return ModifyAudit(modification, rule, out modified);
            }
            finally
            {
                WriteUnlock();
            }
        }
コード例 #52
0
ファイル: CorePsStub.cs プロジェクト: 40a/PowerShell
 protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
 {
     throw new NotImplementedException();
 }
コード例 #53
0
ファイル: ObjectSecurityT.cs プロジェクト: rsumner31/corefx2
 public virtual void SetAuditRule(AuditRule <T> rule)
 {
     base.SetAuditRule(rule);
 }
コード例 #54
0
		public override bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified)
		{
			if (this.SaclRetrieved())
			{
				return base.ModifyAuditRule(modification, rule, out modified);
			}
			else
			{
				throw new InvalidOperationException("CannotModifySacl");
			}
		}
コード例 #55
0
ファイル: ObjectSecurityT.cs プロジェクト: rsumner31/corefx2
 public virtual void RemoveAuditRuleAll(AuditRule <T> rule)
 {
     base.RemoveAuditRuleAll(rule);
 }
コード例 #56
0
ファイル: ObjectSecurity.cs プロジェクト: nicolas-raoul/mono
		public virtual bool ModifyAuditRule (AccessControlModification modification, AuditRule rule, out bool modified)
		{
			if (rule == null)
				throw new ArgumentNullException ("rule");

			if (!AuditRuleType.IsAssignableFrom (rule.GetType()))
				throw new ArgumentException ("rule");
				
			return ModifyAudit (modification, rule, out modified);
		}
コード例 #57
0
ファイル: ObjectSecurity.cs プロジェクト: PlumpMath/CIL2Java
 protected abstract bool ModifyAudit(AccessControlModification modification, AuditRule rule, ref bool modified);
コード例 #58
0
 public virtual void SetAuditRule(AuditRule <T> rule)
 {
     SetAuditRule((AuditRule)rule);
 }
コード例 #59
0
 protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified)
 {
     throw new NotImplementedException();
 }
コード例 #60
0
 public virtual void SetAuditRule(AuditRule <T> rule)
 {
     throw new NotImplementedException();
 }