Role-based Authorization Strategy:

注释:按角色授权。

安装插件:

Jenkins插件Role-based Authorization Strategy_jenkins角色插件

授权策略:

系统管理-全局安全配置-授权策略.

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_02

添加两个用户,分别是java和php:

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_03

Manage Roles创建:

系统管理->Manage and Assign Roles->Manage roles

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_04

创建结果:

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_05

再创建一个php的角色:

Jenkins插件Role-based Authorization Strategy_jenkins角色插件_06

给2个角色分配权限:

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_07

配置完成,点击保存。

分配角色:

Jenkins插件Role-based Authorization Strategy_jenkins角色插件_08

添加用户并绑定角色:

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_09

测试验证配置:

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_10

登录发现java用户没有read权限:

Jenkins插件Role-based Authorization Strategy_jenkins角色插件_11

创建全局read角色,分配只读权限:

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_12

分配权限:

Jenkins插件Role-based Authorization Strategy_jenkins角色插件_13

分别切换到java和php用户查看:

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_14

Jenkins插件Role-based Authorization Strategy_jenkins角色插件_15

测试视图功能,会不会对匹配规则有影响?Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_16

切换java用户查看:

Jenkins插件Role-based Authorization Strategy_Role-based Authoriza_17