summaryrefslogtreecommitdiffstats
path: root/tests/yamlparser/fixtures/auth-jobs
diff options
context:
space:
mode:
authorAdam Romanek <romanek.adam@gmail.com>2020-05-11 13:31:50 +0200
committerAdam Romanek <romanek.adam@gmail.com>2020-05-13 14:16:45 +0200
commit074985c7ff9360bb58be80ffab686746267f814f (patch)
tree750db91aeac4e3ad190ae40d745f2b45ef4d4668 /tests/yamlparser/fixtures/auth-jobs
parentdc36dca4791897521cc19203267656eb8d736183 (diff)
downloadpython-jenkins-job-builder-074985c7ff9360bb58be80ffab686746267f814f.tar.gz
python-jenkins-job-builder-074985c7ff9360bb58be80ffab686746267f814f.tar.xz
python-jenkins-job-builder-074985c7ff9360bb58be80ffab686746267f814f.zip
Fix Authorization Matrix property support on jobs in a folder
Without the fix: > 2020-05-11 10:56:12.238+0000 [id=29522] WARNING > o.e.j.s.h.ContextHandler$Context#log: Error while serving http://localhost/job/someFolder/createItem > java.lang.ClassCastException: com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty cannot be cast to hudson.model.JobProperty It turns out com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty should only be applied to Folders, not Jobs. The latter should use hudson.security.AuthorizationMatrixProperty. Task: 39760 Story: 2007666 Change-Id: I64907265b214fb1e489e1e657a30c90d6ee08c3f
Diffstat (limited to 'tests/yamlparser/fixtures/auth-jobs')
-rw-r--r--tests/yamlparser/fixtures/auth-jobs/project-in-folder-with-auth-properties.xml20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/yamlparser/fixtures/auth-jobs/project-in-folder-with-auth-properties.xml b/tests/yamlparser/fixtures/auth-jobs/project-in-folder-with-auth-properties.xml
new file mode 100644
index 00000000..3669b217
--- /dev/null
+++ b/tests/yamlparser/fixtures/auth-jobs/project-in-folder-with-auth-properties.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project>
+ <actions/>
+ <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
+ <keepDependencies>false</keepDependencies>
+ <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
+ <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+ <concurrentBuild>false</concurrentBuild>
+ <canRoam>true</canRoam>
+ <properties>
+ <hudson.security.AuthorizationMatrixProperty>
+ <inheritanceStrategy class="org.jenkinsci.plugins.matrixauth.inheritance.InheritParentStrategy"/>
+ <permission>hudson.model.Item.Build:auser</permission>
+ </hudson.security.AuthorizationMatrixProperty>
+ </properties>
+ <scm class="hudson.scm.NullSCM"/>
+ <builders/>
+ <publishers/>
+ <buildWrappers/>
+</project>