예제 #1
0
        public ClientAclItem[] GetAcls(string id)
        {
            var acls = AUAclAdapter.Instance.LoadByContainerID(id, SimpleRequestSoapMessage.Current.TimePoint);

            ClientAclItem[] result = new ClientAclItem[acls.Count];

            for (int i = 0; i < result.Length; i++)
            {
                result[i] = acls[i].ToClientObject();
            }

            return(result);
        }
예제 #2
0
        public static SCAclItem ToSCAcl(this ClientAclItem clientAcl)
        {
            clientAcl.NullCheck("pcAcl");

            SCAclItem result = new SCAclItem()
            {
                ContainerID         = clientAcl.ContainerID,
                ContainerPermission = clientAcl.ContainerPermission,
                ContainerSchemaType = clientAcl.ContainerSchemaType,
                MemberID            = clientAcl.MemberID,
                MemberSchemaType    = clientAcl.MemberSchemaType,
                SortID           = clientAcl.SortID,
                VersionEndTime   = clientAcl.VersionStartTime,
                VersionStartTime = clientAcl.VersionEndTime,
                Status           = (SchemaObjectStatus)clientAcl.Status
            };

            return(result);
        }
예제 #3
0
        public static ClientAclItem ToClientObject(this SCAclItem pcAcl)
        {
            pcAcl.NullCheck("pcAcl");

            ClientAclItem result = new ClientAclItem()
            {
                ContainerID         = pcAcl.ContainerID,
                ContainerPermission = pcAcl.ContainerPermission,
                ContainerSchemaType = pcAcl.ContainerSchemaType,
                MemberID            = pcAcl.MemberID,
                MemberSchemaType    = pcAcl.MemberSchemaType,
                SortID           = pcAcl.SortID,
                VersionEndTime   = pcAcl.VersionStartTime,
                VersionStartTime = pcAcl.VersionEndTime,
                Status           = (ClientSchemaObjectStatus)pcAcl.Status
            };

            return(result);
        }
		public ClientAclItem[] GetAcls(string id)
		{
			id.NullCheck("id");

			var acls = PC.Adapters.SCAclAdapter.Instance.LoadByContainerID(id, SimpleRequestSoapMessage.Current.TimePoint);

			ClientAclItem[] result = new ClientAclItem[acls.Count];

			for (int i = 0; i < result.Length; i++)
				result[i] = acls[i].ToClientObject();

			return result;
		}
		public void UpdateObjectAcl(string ownerID, ClientAclItem[] clientAcls)
		{
			var owner = PC.Adapters.SchemaObjectAdapter.Instance.Load(ownerID);

			if (owner == null || owner.Status != SchemaObjectStatus.Normal)
				throw new InvalidOperationException("指定对象不存在或已删除");

			PC.Permissions.SCAclContainer container = new PC.Permissions.SCAclContainer(owner);

			foreach (ClientAclItem item in clientAcls)
			{
				if (item.Status == ClientSchemaObjectStatus.Normal)
					container.Members.Add(item.ToSCAcl());
			}

			container.Members.MergeChangedItems(PC.Adapters.SCAclAdapter.Instance.LoadByContainerID(ownerID, DateTime.MinValue));

			Facade.UpdateObjectAcl(container);
		}
		public void UpdateObjectAcl(string ownerID, ClientAclItem[] clientAcls)
		{
			this.Invoke("UpdateObjectAcl", new object[] { ownerID, clientAcls });
		}