如何为AD用户/组分配Jenkins项目视图的角色访问权限?
回答
Absolutely! The Role Strategy Plugin fully supports assigning view-based role permissions to AD users or groups. Here's a straightforward walkthrough to set this up:
Step 1: Create a View Role
- Navigate to Manage Jenkins → Manage and Assign Roles → switch to the Manage Roles tab.
- Scroll down to the View roles section, click Add Role.
- Give your role a clear name (e.g.,
ProjectX-View-Editor), then check the permissions this role needs—common options includeView(access the view),Configure(edit view settings),Delete(remove the view), etc.
Step 2: Assign AD Users/Groups to the View Role
- Switch to the Assign Roles tab.
- Locate the View Roles section. Next to the role you just created, enter the AD username (e.g.,
DOMAIN\john.doe) or AD group name (e.g.,DOMAIN\ProjectX-Team) in the input field, then click Add.
Step 3: Bind the Role to Specific Views
- Go back to the Manage Roles tab's View roles section.
- In the Pattern column for your view role, enter the exact name of the target view (e.g.,
ProjectX-Dashboard) or use a regex pattern to match multiple views (e.g.,Project.*-Dashboardfor all views starting with "Project" and ending with "Dashboard"). This links the role to the intended views.
Key Notes:
- Verify that your AD users/groups are properly recognized in Jenkins first—you can check this via Manage Jenkins → Manage Users or by searching for users in the assign roles interface.
- View permissions and project permissions are separate. If users need to access the projects within the view, you’ll need to assign corresponding project roles alongside the view role.
- Double-check regex patterns if you’re matching multiple views to avoid accidentally granting access to unintended views.
内容的提问来源于stack exchange,提问作者Vasyl Stepulo
相关产品推荐
相关产品推荐

