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

Rebuild not respecting permissions like manualTrigger does

    Details

    • Similar Issues:

      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

          Hide
          patbos Patrik Boström added a comment -

          Released in 0.9.5

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

          Merged PR

          Show
          patbos Patrik Boström added a comment - Merged PR
          Hide
          patbos Patrik Boström added a comment -
          Show
          patbos Patrik Boström added a comment - I have created a PR with a fix https://github.com/Diabol/delivery-pipeline-plugin/pull/122
          Hide
          nnordrum Noah Nordrum added a comment -

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

          Show
          nnordrum Noah Nordrum added a comment - Apparently it's more complicated, but I think I got it all. I'll submit a PR.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: