예제 #1
0
 private WrappedAUSchemaRole CreateWrappedRole(AUClient.ClientAUSchemaRole item)
 {
     return(new WrappedAUSchemaRole(item.ID)
     {
         Description = item.Name
     });
 }
예제 #2
0
 private MCS.Web.WebControls.DeluxeTreeNode CreateNode(AUClient.ClientAUSchemaRole item)
 {
     return(new MCS.Web.WebControls.DeluxeTreeNode()
     {
         ChildNodesLoadingType = MCS.Web.WebControls.ChildNodesLoadingTypeDefine.Normal,
         Text = item.Name,
         Value = item.ID,
         ExtendedData = JSONSerializerExecute.Serialize(new WfAURoleResourceDescriptor(CreateWrappedRole(item))),
         NodeOpenImg = RoleImgUri,
         NodeCloseImg = RoleImgUri,
         ExtendedDataKey = "AUSchemaRoles"
     });
 }
		public void AddAdminSchemaRole(ClientAUSchemaRole role, ClientAUSchema schema)
		{
			CheckIDProvided(schema);
			EnsureID(role);
			this.Facade.AddAdminSchemaRole((AUSchemaRole)role.ToSchemaObject(false), (AUSchema)schema.ToSchemaObject(true));
		}
		public void ReplaceUsersInRole(ClientGenericObject[] users, ClientAdminUnit unit, ClientAUSchemaRole role)
		{
			users.NullCheck("users"); unit.NullCheck("unit"); role.NullCheck("role");
			 CheckIDProvided(unit); CheckIDProvided(role);
			SCUser[] scUsers = new SCUser[users.Length];
			for (int i = users.Length - 1; i >= 0; i--)
				scUsers[i] = (SCUser)users[i].ToSchemaObject();

			this.Facade.ReplaceUsersInRole(scUsers, (AdminUnit)unit.ToSchemaObject(), (AUSchemaRole)role.ToSchemaObject());
		}
		public void RemoveUserFromRole(ClientGenericObject user, ClientAdminUnit unit, ClientAUSchemaRole role)
		{
			user.NullCheck("user"); unit.NullCheck("unit"); role.NullCheck("role");
			CheckIDProvided(user); CheckIDProvided(unit); CheckIDProvided(role);

			SCUser scUser = new SCUser()
			{
				ID = user.ID,
				Name = user.Properties.GetValue("Name", string.Empty),
				CodeName = user.Properties.GetValue("CodeName", string.Empty)
			};

			this.Facade.RemoveUserFromRole(scUser, (AdminUnit)unit.ToSchemaObject(), (AUSchemaRole)role.ToSchemaObject());
		}
		public void AddUserToRole(ClientGenericObject user, ClientAdminUnit unit, ClientAUSchemaRole role)
		{
			user.NullCheck("user"); unit.NullCheck("unit"); role.NullCheck("role");
			CheckIDProvided(user); CheckIDProvided(unit); CheckIDProvided(role);

			if (string.IsNullOrEmpty(user.ID))
				throw new ArgumentException("user的ID必须不为null", "user");

			SCUser scUser = new SCUser()
			{
				ID = user.ID,
				Name = user.Properties.GetValue("Name", string.Empty),
				CodeName = user.Properties.GetValue("CodeName", string.Empty)
			};

			this.Facade.AddUserToRole(scUser, (AdminUnit)unit.ToSchemaObject(), (AUSchemaRole)role.ToSchemaObject());
		}
		public void UpdateAdminSchemaRole(ClientAUSchemaRole role)
		{
			CheckIDProvided(role);
			this.Facade.UpdateAdminSchemaRole((AUSchemaRole)role.ToSchemaObject(true));
		}