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 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 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()); }