public AUReplaceAclRecursivelyExecutor(AUOperationType opType, ISCAclContainer parent) :
			base(opType)
		{
			parent.NullCheck("parent");

			this._Parent = parent;
			this.AutoStartTransaction = false;
		}
        public SCReplaceAclRecursivelyExecutor(SCOperationType opType, ISCAclContainer parent) :
            base(opType)
        {
            parent.NullCheck("parent");

            this._Parent = parent;
            this.AutoStartTransaction = false;
        }
        /// <summary>
        /// 准备数据
        /// </summary>
        /// <param name="sourceObj"></param>
        private void PrepareCandidatesRecursively(ISCAclContainer sourceObj)
        {
            if (sourceObj is ISCRelationContainer)
            {
                SchemaObjectCollection objs = ((ISCRelationContainer)sourceObj).CurrentChildren;

                foreach (SchemaObjectBase obj in objs)
                {
                    if (obj is ISCAclContainer && (this._ForceReplace || obj.Properties.GetValue("AllowAclInheritance", true)))
                    {
                        PrepareCandidatesRecursively((ISCAclContainer)obj);

                        AddCandidates(obj);
                    }
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// 递归替换子对象的Acl
        /// </summary>
        /// <param name="container"></param>
        /// <param name="forceReplace">是否强制覆盖</param>
        /// <returns></returns>
        public ISCAclContainer ReplaceAclRecursively(ISCAclContainer container, bool forceReplace)
        {
            if (this._NeedCheckPermissions)
            {
                CheckUpdateAclPermissions(AUOperationType.UpdateObjectAcl, ((SchemaObjectBase)container).ID);
            }

            AUReplaceAclRecursivelyExecutor executor =
                new AUReplaceAclRecursivelyExecutor(AUOperationType.ReplaceAclRecursively, container)
            {
                ForceReplace = forceReplace
            };

            ISCAclContainer result = null;

            ExecuteWithActions(AUOperationType.UpdateObjectAcl, () => SCActionContext.Current.DoActions(() => result = (ISCAclContainer)executor.Execute()));

            return(result);
        }
Exemple #5
0
		/// <summary>
		/// 递归替换子对象的Acl
		/// </summary>
		/// <param name="container"></param>
		/// <param name="forceReplace">是否强制覆盖</param>
		/// <returns></returns>
		public ISCAclContainer ReplaceAclRecursively(ISCAclContainer container, bool forceReplace)
		{

			if (this._NeedCheckPermissions)
				CheckUpdateAclPermissions(AUOperationType.UpdateObjectAcl, ((SchemaObjectBase)container).ID);

			AUReplaceAclRecursivelyExecutor executor =
				new AUReplaceAclRecursivelyExecutor(AUOperationType.ReplaceAclRecursively, container) { ForceReplace = forceReplace };

			ISCAclContainer result = null;

			ExecuteWithActions(AUOperationType.UpdateObjectAcl, () => SCActionContext.Current.DoActions(() => result = (ISCAclContainer)executor.Execute()));

			return result;
		}
		/// <summary>
		/// 准备数据
		/// </summary>
		/// <param name="sourceObj"></param>
		private void PrepareCandidatesRecursively(ISCAclContainer sourceObj)
		{
			if (sourceObj is ISCRelationContainer)
			{
				SchemaObjectCollection objs = ((ISCRelationContainer)sourceObj).CurrentChildren;

				foreach (SchemaObjectBase obj in objs)
				{
					if (obj is ISCAclContainer && (this._ForceReplace || obj.Properties.GetValue("AllowAclInheritance", true)))
					{
						PrepareCandidatesRecursively((ISCAclContainer)obj);

						AddCandidates(obj);
					}
				}
			}
		}