override def postrun()

in app/postrun/UpdateProjectPermissions.scala [87:119]


  override def postrun(projectFileName: String,
                       projectEntry: ProjectEntry,
                       projectType: ProjectType,
                       dataCache: PostrunDataCache,
                       workingGroupMaybe: Option[PlutoWorkingGroup],
                       commissionMaybe: Option[PlutoCommission]): Future[Try[PostrunDataCache]] = Future {
    val projectFilePath = Paths.get(projectFileName)

    checkFileExists(projectFilePath) match {
      case Success(true)=>
        (
          getWantedGroup(projectFilePath.getFileSystem, config),
          getWantedPerms(config)
        ) match {
          case (Success(group), Success(permissions))=>
            setPerms(projectFilePath, group, permissions).map(_=>dataCache)
          case (Failure(groupErr), Failure(permsErr))=>
            logger.error(s"Could not get required group or permissions: ${groupErr.getMessage}; ${permsErr.getMessage}")
            Failure(new RuntimeException("Group and permissions configuration were incorrect, see logs"))
          case (Failure(groupErr), _)=>
            logger.error(s"Could not get required group: ${groupErr.getMessage}")
            Failure(new RuntimeException("Group configuration was incorrect, see logs"))
          case (_, Failure(permsErr))=>
            logger.error(s"Could not get required permissions: ${permsErr.getMessage}")
            Failure(new RuntimeException("Permissions configuration was incorrect, see logs"))
        }
      case Success(false)=>
        Failure(new RuntimeException(s"Project file $projectFilePath did not exist"))
      case Failure(err)=>
        logger.error(s"Could not check file existence: ${err.getMessage}")
        Failure(err)
    }
  }