summaryrefslogtreecommitdiffstats
path: root/tests/yamlparser/fixtures/project-in-folder-with-auth-properties2.yaml
diff options
context:
space:
mode:
authorAdam Romanek <romanek.adam@gmail.com>2020-07-15 13:11:33 +0200
committerAdam Romanek <romanek.adam@gmail.com>2020-07-15 13:11:33 +0200
commit703a76650f746bad713fef55389a616f0067255a (patch)
tree5786b501c02ea1ced86019d4ea0163a913c524e7 /tests/yamlparser/fixtures/project-in-folder-with-auth-properties2.yaml
parent28e43831e9facb5bdd1169f3af845aad5bf0c717 (diff)
downloadpython-jenkins-job-builder-703a76650f746bad713fef55389a616f0067255a.tar.gz
python-jenkins-job-builder-703a76650f746bad713fef55389a616f0067255a.tar.xz
python-jenkins-job-builder-703a76650f746bad713fef55389a616f0067255a.zip
Fix Authorization Matrix property - inheritance strategy
Up until now <inheritanceStrategy> tag was only added to jobs-in-a-folder and folder configs. In JJB the tag's class is always set to "InheritParentStrategy" which according to the docs means the "item will inherit its parent items permissions". Apparently <inheritanceStrategy> tag needs to be present on top-level jobs also. For top-level jobs setting the tag's class value to "InheritParentStrategy" means the job "will inherit the global security security settings" and this is the default behavior. The code has simplified a bit - if it's a folder then we use a different property name for authorization matrix property, other than that the code is the same for all three "variants": folder, job-in-a-folder and job-outside-a-folder (top-level job). Also this change fixes the missing <inheritanceStrategy> tag for job-in-a-folder, where the folder name was specified as part of the "name" key instead of the standalone "folder" key. With this change we no longer check if a job is in a folder or not, so it's implicitly fixed. Added a test case to catch potential regressions in the future. The copyright notice reflects this and the previous contribution in this module. Change-Id: I84b22c09c8a107aab2b4eca20feffc9b61675a92
Diffstat (limited to 'tests/yamlparser/fixtures/project-in-folder-with-auth-properties2.yaml')
-rw-r--r--tests/yamlparser/fixtures/project-in-folder-with-auth-properties2.yaml8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/yamlparser/fixtures/project-in-folder-with-auth-properties2.yaml b/tests/yamlparser/fixtures/project-in-folder-with-auth-properties2.yaml
new file mode 100644
index 00000000..8351c473
--- /dev/null
+++ b/tests/yamlparser/fixtures/project-in-folder-with-auth-properties2.yaml
@@ -0,0 +1,8 @@
+- job:
+ # folder name specified as part of job name
+ name: auth-jobs/auth-job-test
+ project-type: freestyle
+ properties:
+ - authorization:
+ auser:
+ - job-build