title: Jenkins DSL: LDAP Roles
body: <p>In our company, all Jenkins jobs are only created via the Jenkins DSL. Our Jenkins permissions are controlled via LDAP. For this we use the Jenkins LDAP Plugin (<a href="https://wiki.jenkins.io/display/JENKINS/LDAP+Plugin" rel="nofollow noreferrer">https://wiki.jenkins.io/display/JENKINS/LDAP+Plugin</a>) version 1.20.</p>
  
  <p>Currently individual LDAP users are authorized:</p>
  
  <pre><code>freeStyleJob ('Jobname') {
  [...]
      authorization {
          permission('hudson.model.Item.Build', 'User1')
          permission('hudson.model.Item.Build', 'User2')
          [...]
      }
  [...]
  }
  </code></pre>
  
  <p>I would like to use LDAP groups instead of authorizing individual users:</p>
  
  <pre><code>freeStyleJob ('Jobname') {
  [...]
      authorization {
          permission('hudson.model.Item.Build', 'LDAPROLE_BUILD')
      }
  [...]
  }
  </code></pre>
  
  <p>How do I have to adjust my DSL files to use LDAP roles instead of single users?</p>