Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-28845

Rebuild not respecting permissions like manualTrigger does

    XMLWordPrintable

Details

    Description

      in pipe.js

      if (data.allowManualTriggers && task.manual && task.manualStep.enabled && task.manualStep.permission) {
                                  html.push('<div class="task-manual" id="manual-' + id + '" onclick="triggerManual(\'' + id + '\', \'' + task.id + '\', \'' + task.manualStep.upstreamProject + '\', \'' + task.manualStep.upstreamId + '\');">');
                                  html.push("</div>");
                              } else {
                                  if (!pipeline.aggregated && data.allowRebuild && task.rebuildable) {
                                      html.push('<div class="task-rebuild" id="rebuild-' + id + '" onclick="triggerRebuild(\'' + id + '\', \'' + task.id + '\', \'' + task.buildId + '\');">');
                                      html.push("</div>");
                                  }
                              }
      

      Rebuildable tasks don't check permissions until after they are submitted. I believe you should just be able to add "&& task.manualStep.permission" to the end of the if statement on line 168.

      Attachments

        Activity

          nnordrum Noah Nordrum added a comment -

          Apparently it's more complicated, but I think I got it all. I'll submit a PR.

          nnordrum Noah Nordrum added a comment - Apparently it's more complicated, but I think I got it all. I'll submit a PR.
          patbos Patrik Boström added a comment - I have created a PR with a fix https://github.com/Diabol/delivery-pipeline-plugin/pull/122

          Merged PR

          patbos Patrik Boström added a comment - Merged PR

          Released in 0.9.5

          patbos Patrik Boström added a comment - Released in 0.9.5

          People

            patbos Patrik Boström
            nnordrum Noah Nordrum
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: