Skip to content

Commit

Permalink
JEP-224, JEP-223 - Add users with System Read and Manage permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-nenashev committed May 27, 2020
1 parent d249f6c commit 957913f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
8 changes: 5 additions & 3 deletions init_scripts/src/main/groovy/scripts/Auth.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ boolean createAdmin = Boolean.getBoolean("io.jenkins.dev.security.createAdmin")

println("=== Configuring users")
def securityRealm = Jenkins.instance.getSecurityRealm()
User user = securityRealm.createAccount("user", "user")
user.setFullName("User")
securityRealm.createAccount("user", "user").setFullName("User")
securityRealm.createAccount("readonly", "readonly").setFullName("Read-only Admin")
securityRealm.createAccount("manager", "manager").setFullName("Admin (Manage)")

if (createAdmin) {
User admin = securityRealm.createAccount("admin", "admin")
admin.setFullName("Admin")
admin.setFullName("Admin (Full Permissions)")
}

println("=== Configure Authorize Project")
Expand Down
18 changes: 16 additions & 2 deletions jenkins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,26 @@ jenkins:
roles:
global:
- name: "admin"
description: "Jenkins administrators"
description: "Jenkins administrators with full permissions"
permissions:
- "Overall/Administer"
assignments:
- "admin"
- name: "readonly"
- name: "manager"
description: "Jenkins managers with limited admin permissions"
permissions:
- "Overall/Manage"
assignments:
- "manager"
- name: "readonly-admin"
description: "Jenkins read-only administrators"
permissions:
- "Overall/SystemRead"
- "Job/Read"
- "Agent/Read"
assignments:
- "readonly"
- name: "readonly-user"
description: "Read-only users"
permissions:
- "Overall/Read"
Expand Down
2 changes: 2 additions & 0 deletions plugins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ configuration-as-code:1.41
docker-commons:1.16
docker-workflow:1.23
email-ext:2.69
extended-read-permission:3.2
favorite:2.3.2
filesystem_scm:2.1
git-client:3.2.1
Expand All @@ -26,6 +27,7 @@ junit:1.27
locale:1.4
lockable-resources:2.8
mailer:1.32
manage-permission:1.0
matrix-auth:2.6.1
maven-plugin:3.6
momentjs:1.1.1
Expand Down

0 comments on commit 957913f

Please sign in to comment.