コード例 #1
0
        override public IPermission Union(IPermission target)
        {
            if (null == target)
            {
                return(this.Copy());
            }
            if (target.GetType() != this.GetType())
            {
                throw ADP.PermissionTypeMismatch();
            }
            if (IsUnrestricted())   // MDAC 84803
            {
                return(this.Copy());
            }

            DBDataPermission newPermission = (DBDataPermission)target.Copy();

            if (!newPermission.IsUnrestricted())
            {
                newPermission._allowBlankPassword |= AllowBlankPassword;

                if (null != _keyvalues)
                {
                    foreach (DBConnectionString entry in _keyvalues)
                    {
                        newPermission.AddPermissionEntry(entry);
                    }
                }
            }
            return(newPermission.IsEmpty() ? null : newPermission);
        }
コード例 #2
0
        public override IPermission Union(IPermission target)
        {
            if (target == null)
            {
                return(this.Copy());
            }
            if (target.GetType() != base.GetType())
            {
                throw ADP.PermissionTypeMismatch();
            }
            if (this.IsUnrestricted())
            {
                return(this.Copy());
            }
            DBDataPermission permission = (DBDataPermission)target.Copy();

            if (!permission.IsUnrestricted())
            {
                permission._allowBlankPassword |= this.AllowBlankPassword;
                if (this._keyvalues != null)
                {
                    foreach (DBConnectionString str in this._keyvalues)
                    {
                        permission.AddPermissionEntry(str);
                    }
                }
            }
            if (!permission.IsEmpty())
            {
                return(permission);
            }
            return(null);
        }