IdP group role bindings
IdP groups can receive roles through direct group assignment. Assign roles to the entire group, which automatically applies to all members of that group.
Assigning roles
Assigning roles to IdP groups using the web UI
- Prerequisites
- The selected management strategy for your organization must be User Management
- Your identity provider must be connected to Spacelift
- You must have appropriate permissions to manage user group roles
- Target spaces must exist where you want to assign roles
- Navigate to IdP Group Mapping
- Click your name in the bottom left corner of the Spacelift interface
- Go to Organization Settings → Identity Management -> IdP group mapping
- Create IdP group mapping
- Click Map IdP group
- Enter the id of the IdP group (this is the id of the group in your identity provider, e.g., GitHub team slug)
- Select the Role you want to assign to the group
- Select the Space where the group should have this role
- Click Add to add role assignment
- Click Add to save the group mapping
- Access Group Role Management
- Click on the group row in the group list
- Click the Manage Roles button
- This opens the group role assignment interface
Refer to the Spacelift Terraform provider documentation for detailed instructions on creating IdP group mappings programmatically.
Assigning roles to IdP groups using the login policies
- Prerequisites
- The selected management strategy for your organization must be Login Policies
- You must have appropriate permissions to create or modify login policies
- Understanding of OPA/Rego policy language
- Use the
roles
rule to assign roles to users:
| package spacelift
allow { input.session.member }
# Assign role based on team membership
roles[space][role_id] {
input.session.teams[_] == "team-name"
}
|
Individual group assignment
1
2
3
4
5
6
7
8
9
10
11
12
13 | package spacelift
allow { input.session.member }
# DevOps team gets platform engineer role
roles["infrastructure"]["platform-engineer-role-id"] {
input.session.teams[_] == "DevOps"
}
# Frontend team gets developer role
roles["frontend"]["developer-role-id"] {
input.session.teams[_] == "Frontend"
}
|
Multiple teams, same role
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 | package spacelift
allow { input.session.member }
# Define team sets
developer_teams := {"Frontend", "Backend", "Mobile", "QA"}
platform_teams := {"DevOps", "SRE", "Platform"}
# Assign developer access
roles["applications"]["developer-role-id"] {
developer_teams[input.session.teams[_]]
}
# Assign platform access
roles["infrastructure"]["platform-role-id"] {
platform_teams[input.session.teams[_]]
}
|
Hierarchical team access
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 | package spacelift
allow { input.session.member }
# Junior developers: development only
roles["development"]["junior-dev-role-id"] {
input.session.teams[_] == "Junior-Developers"
}
# Senior developers: development + staging
roles[space]["senior-dev-role-id"] {
input.session.teams[_] == "Senior-Developers"
senior_spaces := {"development", "staging"}
senior_spaces[space]
}
# Team leads: all environments
roles[space]["team-lead-role-id"] {
input.session.teams[_] == "Team-Leads"
all_spaces := {"development", "staging", "production"}
all_spaces[space]
}
|
Department-based access
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 | package spacelift
allow { input.session.member }
# Engineering department base access
roles["development"]["engineer-role-id"] {
input.session.teams[_] == "Engineering"
}
# Operations department infrastructure access
roles["infrastructure"]["ops-role-id"] {
input.session.teams[_] == "Operations"
}
# Security department audit access across all spaces
roles[space]["security-auditor-role-id"] {
input.session.teams[_] == "Security"
# Apply to all spaces
space := input.spaces[_].id
}
|
Project and functional groups
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 | package spacelift
allow { input.session.member }
# Project-based access
roles["project-alpha"]["developer-role-id"] {
input.session.teams[_] == "Project-Alpha-Team"
}
roles["project-beta"]["developer-role-id"] {
input.session.teams[_] == "Project-Beta-Team"
}
# Functional role overlays
roles["infrastructure"]["platform-role-id"] {
input.session.teams[_] == "Platform-Engineers"
}
roles[space]["security-role-id"] {
input.session.teams[_] == "Security-Champions"
# Security champions get audit access everywhere
space := input.spaces[_].id
}
|
Multi-condition team assignment
1
2
3
4
5
6
7
8
9
10
11
12 | package spacelift
allow { input.session.member }
# Production access requires both team membership and seniority
roles["production"]["prod-deployer-role-id"] {
deployment_teams := {"DevOps", "SRE", "Platform"}
deployment_teams[input.session.teams[_]]
# Additional condition: must also be in senior group
input.session.teams[_] == "Senior-Engineers"
}
|
Troubleshooting
Common issues
Group Permissions Not Working:
- Verify group-to-role assignments are correct
- Check if user is actually a member of the group
- Ensure user has re-authenticated since group assignment
- Validate role includes required actions
Conflicting Group Permissions:
- Multiple groups can provide different roles
- Permissions are additive across group memberships
- Regular audit of group role combinations
Debugging steps
- Verify Group Membership: Check user is member of expected groups in IdP
- Validate Role Assignment: Confirm group has correct role assignments
- Review Audit Logs: Check for group-related permission errors