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

Pattern matching not working with forward slashes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • role-strategy-plugin
    • Jenkins Version 2.249.2 running on Windows Server 2016 Datacenter
      JRE Version 1.8.0_261-b12
      Role Strategy Plugin Version 3.1

      Assume the following folder structure

      Folder1/JobA
      Folder1/JobB
      Folder2/JobC
      

      The global role for the user only has the Overall/Read permission and the configured project roles have all possible permissions.

      When configuring a new project role for folder1 I want the pattern to be

      ^Folder1/.*
      

      so only JobA and JobB can be accessed.

      But when logging in with a user account that has only this permission only the empty "Welcome to Jenkins" page is displayed.

      If I instead use the pattern

      ^Folder1.*
      

      the user can access Folder1 and all items within as expected.

      This seems to always happen when a forward slash / is used in the pattern and using the second pattern is not an option in my use case as someone could create eg. Folder 10 which would then also be matched.

      Also the preview of matching Projects correctly displays all contents of Folder1 in both cases, although the first pattern doesn't actually grant access.

      I have also tried to escape the forward slash with a backslash ( ^Folder1\/.* ) but that didn't help either.

            oleg_nenashev Oleg Nenashev
            kingart Mr King
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: