[05] Jenkins: User rights management

EDITORIAL words

 

R & D department within a company, there may be multiple operation and maintenance personnel, and operation and maintenance personnel are often responsible for these different projects, but it is possible they are using is the same Jenkins of different users. Then we hope to achieve a demand, different users can see different projects after logging Jenkins. Jenkins provides a simple rights management, we can in  System Management -> Global Security Configuration see:

But here too simple to configure permissions, clearly unable to meet the needs of our copy, so at this time of the introduction of a plug-Jenkins: Role-based the Authorization at Strategy

 

 

插件:Role-based Authorization Strategy

 

Open plug-in center, we can search for:

After the restart Jenkins, re-open : System Management -> Global Security Configuration will find many options we just plug

We chose this configuration, while the system administration emergence of new options:

 

Ready to work:

1. Copy the following for our project to test:

 

2. Create three test user: test / develop / product

Open: System Management -> User Management

End-user formats:

 

Configure permissions:

Open: System Management -> Manage and Assign Roles

We mainly use the above two. A user wants to operate must have two roles, one is global, one is Project:

1. Create a role: the Manage the Roles

2. Assign roles: the Assign the Roles

说明:我们这三个用户其实代表着三个不同的属性,为了区分我给他定义了三种不同角色。这样以后就可以给每个角色授权不一样的权限。

当然,我们这里就给了一个全部的只读权限,用户可以登录,并且修改自己的东西。

 

3. 创建项目角色:Manage Roles

 

4. 给用户分配项目权限:Assign Roles

说明:我们给用户分配不同的项目和权限,便于测试对比。

 

5. 查看权限效果:

test 用户登录后项目:

test 用户项目权限:

test 用户权限说明:test 用户登录后能看到 TEST 开头的项目,包括文件夹,但是对于项目,test 用户都只具有执行权限,而没有修改和配置的权限。

 

develop 用户登录后项目:

develop 用户项目权限:

develop 用户权限说明:可以看到,因为我们多配置了 Config 权限的原因,develop 相比于 test 用户对于分配给自己权限的项目多了修改配置权限。

 

product 用户登录后项目:

product 用户对于 TEST 项目权限:

product 用户对于 PRODUCT 项目权限:

product 用户授权说明:我们可以看到,PROCUDT 项目由于授权了 config 权限,所以用户能够修改,TEST 项目没用 config 权限,虽然同样是授权给了 product 用户,但是也是只有执行权限而已。

至此,基本的权限管理大致完成!

 

 

小结

 

Role 插件相比于系统的虽然完善了不少,但是仍然在很多时候显得不那么只能,而且前端似乎并不友好。但没办法,这东西没得挑。

Guess you like

Origin www.cnblogs.com/Dy1an/p/11202544.html