jenkins the definitive guide

(Jeff_L) #1

administrator. If this happens, do not panic—there is an easy fix, as long as you have access to Jenkins’s
home directory. Simply open up the config.xml file at the root of the Jenkins home directory. This
will contain something like this:


<hudson>
<version>1.391</version>
<numExecutors>2</numExecutors>
<mode>NORMAL</mode>
<useSecurity>true</useSecurity>

The thing to look for is the element. To restore your access to Jenkins, change this
value to false, and restart your server. You will now be able to access Jenkins again, and set up your
security configuration correctly.


7.5.2. Project-based Security


Project-based security lets you build on the matrix-based security model we just discussed, and apply it
to individual projects. Not only can you assign system-wide roles for your users, you can also configure
more specific rights for certain individual projects.


To activate project-level security, select “Project-based Matrix Authorization Strategy” in the
Authorization section of the main configuration screen (see Figure 7.19, “Project-based security”).
Here, you set up the default rights for users and groups, as we saw with Matrix-based security (see
Section 7.5.1, “Matrix-based Security”).


Figure 7.19. Project-based security


These are the default permissions that apply to all projects that have not been specially configured.
However, when you use project-based security, you can also set up special project-specific permissions.
You do this by selecting “Enable project-based security” in the project configuration screen (see
Figure 7.20, “Configuring project-based security”). Jenkins will display a table of project-specific
permissions. You can configure these permissions for different users and groups just like on the system-
wide configuration page. These permissions will be added to the system-wide permissions to produce
a project-specific set of permissions applicable for this project.

Free download pdf