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

Unable to call step currentUserGlobalRoles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • role-strategy-plugin
    • None
    • Jenkins 2.387.2
      Role-based Authorization Strategy Version689.v731678c3e0eb_

      According to documentation https://github.com/jenkinsci/role-strategy-plugin#getting-roles-in-pipelines one can get the user global and item roles by the step currentUserGlobalRoles.

      When attempting to do so, jenkins pipeline fails indicating such DSL step does not exists:
      ```Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 52f9cb3f-470f-45cf-9375-c61c6a1e88cc
      java.lang.NoSuchMethodError: No such DSL method 'currentUserGlobalRoles' found among steps [addBadge, addEmbeddableBadgeConfiguration, addErrorBadge, addHtmlBadge, addInfoBadge, addShortText, addWarningBadge, ansiColor, archive, bat, build, catchError, checkout, compareVersions, container, containerLog, createSummary, datadog, deleteDir```

      Current pipeline definition is:
      #!groovy
      pipeline {
          agent any
          options

      {         timeout(time: 10, unit: 'MINUTES')     }

          stages {
              stage('Checkout') {
                  steps {
                      script

      {                     currentUserGlobalRoles()                 }

                  }
              }
          }
      }

            mawinter69 Markus Winter
            anxietyscroll E
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: