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

AuthorizationMatrixProperty:blocksInheritance isn't supported through DSL for multibranchPipelineJob

      The DSL for the authorization block of the multibranchPipelineJob does not support blocksInheritance. I can go into the job manually once it is created and check the box, but there seems to be no way to set it in the DSL. https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob-authorization Doing this manually defeats the purpose of creating the job through DSL.

          [JENKINS-46865] AuthorizationMatrixProperty:blocksInheritance isn't supported through DSL for multibranchPipelineJob

          Brian Mericle created issue -
          Brian Mericle made changes -
          Description Original: The DSL for the authorization block of the *multibranchPipelineJob* does not support _blocksInheritance_. I can go into the job manually once it is created and check the box, but there seems to be no way to set it in the DSL. [https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob-authorization|[https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob-authorization].] Doing this manually defeats the purpose of creating the job through DSL. New: The DSL for the authorization block of the *multibranchPipelineJob* does not support _blocksInheritance_. I can go into the job manually once it is created and check the box, but there seems to be no way to set it in the DSL. https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob-authorization Doing this manually defeats the purpose of creating the job through DSL.

          Brian Mericle added a comment - - edited

          I was able to get it to work by manipulating the xml through the configure block.

          configure { project ->
            project / 'properties' / 'com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty' {
              blocksInheritance(true)
              permission('hudson.model.Item.Build:authenticated')
              permission('hudson.model.Run.Replay:authenticated')
            }
          }
          
          instead of being able to just do this:
          
          authorization {
             blocksInheritance()
             permission('hudson.model.Item.Build', 'authenticated')
             permission('hudson.model.Run.Replay', 'authenticated')
          }

           

          Brian Mericle added a comment - - edited I was able to get it to work by manipulating the xml through the configure block. configure { project -> project / 'properties' / 'com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty' { blocksInheritance( true )    permission( 'hudson.model.Item.Build:authenticated' ) permission( 'hudson.model.Run.Replay:authenticated' ) } } instead of being able to just do this : authorization { blocksInheritance() permission( 'hudson.model.Item.Build' , 'authenticated' ) permission( 'hudson.model.Run.Replay' , 'authenticated' ) }  
          Andrew Bayer made changes -
          Component/s New: job-dsl-plugin [ 16720 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-multibranch-plugin [ 21465 ]

          Daniel Spilker added a comment - blocksInheritance is deprecated, see  https://github.com/jenkinsci/matrix-auth-plugin/blob/matrix-auth-2.0-beta-3/src/main/java/com/cloudbees/hudson/plugins/folder/properties/AuthorizationMatrixProperty.java#L84-L89
          Daniel Spilker made changes -
          Assignee New: Daniel Spilker [ daspilker ]
          Resolution New: Won't Fix [ 2 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Daniel Spilker made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            daspilker Daniel Spilker
            bpmericle Brian Mericle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: