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

Approve assuming permission check for parameters change actions

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: script-security-plugin
    • Labels:
      None
    • Environment:
      jenkins 2.138.2
      script-security 1.48
    • Similar Issues:

      Description

      Our users have an example of code for change build parameters. It uses "dangerous"

      method org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper getRawBuild.

      We firstly approve method as "Approve assuming permission check", but error "Scripts not permitted" still appears. Code works only if methods "Approved" (not "Approved assuming permission check"). It is normal behaviour?

      code example (need to create in job parameter newparam):

      import hudson.model.Actionable
      import hudson.model.ParametersAction
      import hudson.model.ParameterValue
      import hudson.model.StringParameterValue
      def paramName = 'newparam'
      def paramValue = 'newvalue'
          setParam(paramName, paramValue)
      echo ("NEW ${paramName} = ${newparam}")
      //======================================================================================================================
      void setParam(String paramName, String paramValue) {
          def build = currentBuild.getRawBuild()
          List<ParameterValue> newParams = new ArrayList<>()
          newParams.add(new StringParameterValue(paramName, paramValue))
          build.addOrReplaceAction(build.getAction(ParametersAction.class).createUpdated(newParams))
      }
      

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              alexanderu Alexander Ukhanov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: