title: Jenkins: How to get a users LDAP groups in groovy-script
body: <p>i have setup a parametrized job for self-service deployments in Jenkins.
  Users can select a version of the application and the environment to deploy to.
  The available environments displayed to the user is currently just a static list of strings (choice parameter).</p>
  
  <p><strong>Now i want to restrict deployments to some environments based on the LDAP-groups of the current user.</strong></p>
  
  <p>The user-page in jenkins displays something like:</p>
  
  <p>Jenkins Benutzer Id: maku</p>
  
  <p>Groups:</p>
  
  <pre><code>adm_proj_a
  nexus_admin
  ROLE_ADM_PROJ_XY
  ROLE_BH_KK
  </code></pre>
  
  <p><strong>How do i get these groups within a groovy-script?</strong></p>
  
  <p>I tried to use <em>dynamic choice parameter (scriptler)</em> and get the LDAP-groups using a groovy-script but did not find my way through the Jenkins-API.</p>
  
  <p>Any hints welcome</p>