• 548.vb_60076577ec7

      Currently, the "role strategy" plugin allows you to restrict access to jobs, based on a job-name pattern, using "Project roles". The following permissions are available:

      Delete Configure Read Discover Build Workspace Cancel

      However, I can't give a user permissions to create only jobs that match a certain job-name pattern. "Job Create" privilege is a "Global Role", not a "Project Role".
      Can this be fixed?

          [JENKINS-19934] Add "Job Create" permission to project roles

          Matthew Webber created issue -

          The same issue.

          Kanstantsin Shautsou added a comment - The same issue.

          Oleg Nenashev added a comment -

          I've updated the description somewhere, but have not managed to find such update

          Regexp-driven "Create" permissions in jobs and slaves require mechanisms, which are not available within the current Jenkins core version.
          The workaround is to create a job name verifier extension ("Restrict project naming"), which takes the data from the strategy and enforces it for users.

          I won't be able to handle this feature request soon.
          Feel free to contribute.

          Oleg Nenashev added a comment - I've updated the description somewhere, but have not managed to find such update Regexp-driven "Create" permissions in jobs and slaves require mechanisms, which are not available within the current Jenkins core version. The workaround is to create a job name verifier extension ("Restrict project naming"), which takes the data from the strategy and enforces it for users. I won't be able to handle this feature request soon. Feel free to contribute.
          Oleg Nenashev made changes -
          Assignee Original: Oleg Nenashev [ oleg_nenashev ]
          Kanstantsin Shautsou made changes -
          Assignee New: Kanstantsin Shautsou [ integer ]

          Kanstantsin Shautsou added a comment - - edited

          After fix JENKINS-23127 it will be possible to have "role based project naming" extension, but it will require new core or someway to have it optionally. Or assign roles may have "create" checkboxes that will work only on new core and with enabled "project naming".
          So checkbox tip will say "only with project naming strategy", project naming will say "only on core >XXXX".

          Kanstantsin Shautsou added a comment - - edited After fix JENKINS-23127 it will be possible to have "role based project naming" extension, but it will require new core or someway to have it optionally. Or assign roles may have "create" checkboxes that will work only on new core and with enabled "project naming". So checkbox tip will say "only with project naming strategy", project naming will say "only on core >XXXX".

          Oleg Nenashev added a comment -

          Agreed.
          You can just hide the permission from Web UI according to the core version comparison. I do such thing in Dynamic Search View Plugin (see https://github.com/jenkinsci/dynamic-search-view-plugin/commit/bf6869cc36f1dfc7e258a750a596c55b65acfd80)

          Oleg Nenashev added a comment - Agreed. You can just hide the permission from Web UI according to the core version comparison. I do such thing in Dynamic Search View Plugin (see https://github.com/jenkinsci/dynamic-search-view-plugin/commit/bf6869cc36f1dfc7e258a750a596c55b65acfd80 )
          Kanstantsin Shautsou made changes -
          Link New: This issue depends on JENKINS-23127 [ JENKINS-23127 ]

          Code changed in jenkins
          User: Kanstantsin Shautsou
          Path:
          src/main/java/com/michelin/cio/hudson/plugins/rolestrategy/RoleBasedAuthorizationStrategy.java
          src/main/java/org/jenkinsci/plugins/rolestrategy/RoleBasedProjectNamingStrategy.java
          src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/Messages.properties
          src/main/resources/org/jenkinsci/plugins/rolestrategy/RoleBasedProjectNamingStrategy/config.groovy
          src/main/resources/org/jenkinsci/plugins/rolestrategy/RoleBasedProjectNamingStrategy/config.properties
          src/main/resources/org/jenkinsci/plugins/rolestrategy/RoleBasedProjectNamingStrategy/help.html
          http://jenkins-ci.org/commit/role-strategy-plugin/d5178f39de2f2e453f98b4637248bcfec77e8de4
          Log:
          [FIXED JENKINS-19934] Job create permission for RoleBasedProjectNamingStrategy.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kanstantsin Shautsou Path: src/main/java/com/michelin/cio/hudson/plugins/rolestrategy/RoleBasedAuthorizationStrategy.java src/main/java/org/jenkinsci/plugins/rolestrategy/RoleBasedProjectNamingStrategy.java src/main/resources/com/michelin/cio/hudson/plugins/rolestrategy/Messages.properties src/main/resources/org/jenkinsci/plugins/rolestrategy/RoleBasedProjectNamingStrategy/config.groovy src/main/resources/org/jenkinsci/plugins/rolestrategy/RoleBasedProjectNamingStrategy/config.properties src/main/resources/org/jenkinsci/plugins/rolestrategy/RoleBasedProjectNamingStrategy/help.html http://jenkins-ci.org/commit/role-strategy-plugin/d5178f39de2f2e453f98b4637248bcfec77e8de4 Log: [FIXED JENKINS-19934] Job create permission for RoleBasedProjectNamingStrategy.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            oleg_nenashev Oleg Nenashev
            mwebber Matthew Webber
            Votes:
            15 Vote for this issue
            Watchers:
            23 Start watching this issue

              Created:
              Updated:
              Resolved: