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

Allow a TopLevelItemDescriptor to specify permissions needed to create an item

    Details

    • Similar Issues:

      Description

      While many job types could reasonably be created by any user with Item.CREATE, some types inherently require more specialized permissions to create, configure, and run: backup jobs, Groovy script jobs, etc. While it is possible to check these other permissions "later", it would be much better to just forbid general users from creating such jobs to begin with—do not even show the option.

      Proposal: add a method to TopLevelItemDescriptor, say boolean canCreate(ItemGroup parent, AccessControlled acl), checking whether the current user is allowed to create an instance of this job type in the selected folder. The default implementation would return true, but a subclass could perform an access check on the target folder.

      ItemGroupMixIn would be responsible for calling the new method to prevent crafted form submissions from being accepted, but the main usage would be from e.g. View/newJob.jelly calling Items.all() and using <n:form>.

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              jglick Jesse Glick
              Reporter:
              jglick Jesse Glick
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: