Add support for user group or multiple users in pipeline approvals#71
Open
petero-dk wants to merge 1 commit into
Open
Add support for user group or multiple users in pipeline approvals#71petero-dk wants to merge 1 commit into
petero-dk wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the logic for determining whether the current user can approve pipeline approvals, especially when approvals may be assigned to user groups in addition to individuals. The main changes introduce a mechanism to resolve and cache all graph descriptors (user and group) that identify the current user as an approver, and update the approval logic to use this information for more accurate permission checks.
Improvements to approval logic:
_approverDescriptorsset and logic in_PipelineDetailControllerto store all descriptors (user and groups) that identify the current user as an approver. This set is fetched when approvals are present. [1] [2]_canApproveand_isBlockedApprovermethods to use a new_isCurrentUserhelper, which checks if anAssignedApprovermatches the current user by email, id, or descriptor (including group membership). This ensures that group-based approvals are correctly recognized.API service enhancements:
getCurrentUserApproverDescriptorsmethod to theAzureApiServiceinterface, and implemented it inAzureApiServiceImpl. This method computes (and caches) all graph descriptors for the current user, including transitive group memberships, by traversing the membership graph. [1] [2] [3]