Support own tenant role access#6
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
❌ This PR title does not follow the Conventional Commits format. Expected format: Allowed types: Examples:
Received: 🔒 This PR has been automatically closed. Please update the title to match the format above and reopen the PR. |
There was a problem hiding this comment.
Pull request overview
Adds support for an Own Tenant allowance in custom roles, intended to scope access to the tenant whose default or initial domain matches the signed-in user’s UPN. This fits into the existing centralized RBAC enforcement performed by Test-CIPPAccess, and exposes the new allowance in the custom-role listing endpoint for UI configuration.
Changes:
- Update custom role listing to surface an Own Tenant option in
AllowedTenants. - Add “own tenant” resolution logic to
Test-CIPPAccessand expandAllowedTenantsentries accordingly. - Extend tenant resolution to also match
initialDomainNamein addition todefaultDomainName.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ListCustomRole.ps1 | Adds UI-facing shaping for AllowedTenants to include an “Own Tenant” display entry. |
| Modules/CIPPCore/Public/Authentication/Test-CIPPAccess.ps1 | Adds own-tenant ID resolution and enforces own-tenant scoping during allowed-tenant expansion and AllTenants handling. |
| $AllowedTenants = $Role.AllowedTenants | ConvertFrom-Json -ErrorAction Stop | ForEach-Object { | ||
| if ($_ -is [PSCustomObject] -and $_.type -eq 'Group') { | ||
| if ($_ -eq 'OwnTenant') { | ||
| [PSCustomObject]@{ | ||
| type = 'OwnTenant' | ||
| value = 'OwnTenant' | ||
| label = 'Own Tenant' | ||
| } | ||
| } elseif ($_ -is [PSCustomObject] -and $_.type -eq 'Group') { |
| } elseif ($AllowedItem -eq 'OwnTenant') { | ||
| $OwnTenantIds | ||
| } else { | ||
| $AllowedItem | ||
| } |
| } elseif ($AllowedItem -eq 'OwnTenant') { | ||
| $OwnTenantIds | ||
| } else { | ||
| $AllowedItem | ||
| } |
| } elseif ($TenantFilter -eq 'AllTenants' -and $Role.AllowedTenants -contains 'OwnTenant' -and $Role.AllowedTenants -notcontains 'AllTenants') { | ||
| $TenantAllowed = $false |
Summary
Adds centralized support for the Own Tenant custom-role allowance. Access is limited to the tenant whose default or initial domain matches the signed-in user's UPN.
Testing
Untested: no build or behavioral test suite was run.