public void AddObjectToScope(AUAdminScopeItem item, AUAdminScope scope) { AdminUnit unit = scope.GetOwnerUnit(); CheckUnitPermission(AUOperationType.AddAdminUnit, "EditAdminScope", unit); AUMemberRelativeExecutor executor = new AUMemberRelativeExecutor(AUOperationType.AddAUScopeItem, scope, item) { SaveTargetData = false, NeedValidation = this.NeedValidationAndStatusCheck, NeedContainerStatusCheck = this.NeedValidationAndStatusCheck, }; ExecuteWithActions(AUOperationType.AddAUScopeItem, () => SCActionContext.Current.DoActions(() => { executor.Execute(); })); }
public void RemoveObjectFromScope(AUAdminScopeItem item, AUAdminScope scope) { AdminUnit unit = scope.GetOwnerUnit(); CheckUnitPermission(AUOperationType.AddAdminUnit, "EditAdminScope", unit); AUMemberRelativeExecutor executor = new AUMemberRelativeExecutor(AUOperationType.AddAUScopeItem, scope, item) { SaveTargetData = false, NeedValidation = this.NeedValidationAndStatusCheck, NeedContainerStatusCheck = this.NeedValidationAndStatusCheck, }; executor.Data.Status = SchemaObjectStatus.Deleted; executor.Relation.Status = SchemaObjectStatus.Deleted; ExecuteWithActions(AUOperationType.AddAUScopeItem, () => SCActionContext.Current.DoActions(() => { executor.Execute(); })); }