def performUpdate()

in app/controllers/UserController.scala [123:145]


  def performUpdate(originalProfile:UserProfile, rq:UserProfileFieldUpdate):Either[String, UserProfile] =
    rq.fieldName match {
      case UserProfileField.IS_ADMIN=>
        getSingleBoolValue(rq).map(newValue=>originalProfile.copy(isAdmin = newValue))
      case UserProfileField.ALL_COLLECTIONS=>
        getSingleBoolValue(rq).map(newValue=>originalProfile.copy(allCollectionsVisible = newValue))
      case UserProfileField.VISIBLE_COLLECTIONS=>
        updateStringList(rq, originalProfile.visibleCollections).map(newValue=>originalProfile.copy(visibleCollections = newValue))
      case UserProfileField.PER_RESTORE_QUOTA=>
        getSingleLongValue(rq).map(newValue=>originalProfile.copy(perRestoreQuota = Some(newValue)))
      case UserProfileField.ROLLING_QUOTA=>
        getSingleLongValue(rq).map(newValue=>originalProfile.copy(rollingRestoreQuota = Some(newValue)))
      case UserProfileField.ADMIN_APPROVAL_QUOTA=>
        getSingleLongValue(rq).map(newValue=>originalProfile.copy(adminAuthQuota = Some(newValue)))
      case UserProfileField.ADMIN_ROLLING_APPROVAL_QUOTA=>
        getSingleLongValue(rq).map(newValue=>originalProfile.copy(adminRollingAuthQuota = Some(newValue)))
      case UserProfileField.DEPARTMENT=>
        getSingleStringValue(rq).map(newValue=>originalProfile.copy(department = Some(newValue)))
      case UserProfileField.PRODUCTION_OFFICE=>
        getSingleStringValue(rq).map(newValue=>originalProfile.copy(productionOffice = Some(newValue)))
      case _=>
        Left(s"Did not recognise field ${rq.fieldName}")
    }