Develop - #883
Merged
Merged
Conversation
add integration for MM in upload_annotations
Add SAClient.grant_team_user_permissions() and SAClient.revoke_team_user_permissions() to manage team-level user permissions, with role-based "*" resolution (contributor vs admin groups) and case-/apostrophe-insensitive permission name lookup. Move the business logic into a new UpdateUserPermissionUseCase, which mirrors the documented cascades client-side because the work-management backend does not auto-cascade through the permissions API: - granting "Manage Contributors' permissions" (id 19) grants every contributor permission (20-25); - granting "Edit Contributors' custom field values" (24) also grants "View Contributors' custom field values" (23); - revoking "View Contributors' custom field values" (23) also revokes "Edit Contributors' custom field values" (24). Cascade rules are keyed by permission id in lib.core constants. Supporting infrastructure: - TeamUserPermissionCache + CachedWorkManagementRepository methods (get_team_user_permission_id, _id_name_map, _groups); - WorkManagementService.edit_team_user_permissions; - abstract methods on the service provider interfaces. Tests: - integration tests covering grant/revoke by email and id, wildcard, already-granted/revoked logging, invalid/mixed permissions, apostrophe normalization, and the cascade cases (master grant, revoke block while master enabled, view->edit custom field revoke); - unit tests for UpdateUserPermissionUseCase cascade/role logic. Also fix a latent bug in coco_converter.get_image_dimensions where the PIL fallback called img.size() (a tuple property) and always raised TypeError; use img.size so the fallback actually works. Bump pillow to 12.3 (latest 12.x; audited usage — no deprecated APIs) and aiohttp to 3.14; bump version to 4.5.9dev1.
Drop the test-only set_team_user_permissions (setpermissions full-replace) helper from the service layer and reset contributors via the edit_team_user_permissions delta endpoint instead. Master-granting integration tests now pick their own disposable contributor and skip when no clean one remains, since the master permission is irreversible via the permissions API. Enforce role validity in UpdateUserPermissionUseCase: a permission that exists but is not allowed for the user's role (e.g. an admin permission requested for a contributor, or vice versa) is dropped client-side and reported as a failure with the "User role does not allow ..." reason, instead of being sent to the backend and poisoning its all-or-nothing batch. Add unit and integration tests covering both role-mismatch directions and the mixed valid + role-invalid case, plus a dedicated team-admin permission integration test suite. Co-authored-by: Cursor <cursoragent@cursor.com>
…AY-5409) Stop hardcoding the "Manage Contributors' permissions" (id 19) grant cascade as [20, 21, 22, 23, 24, 25]. The set of contributor permissions can vary per team (e.g. id 25 may be absent depending on configuration), so derive the master's cascade at runtime from the /permissiongroups response: it grants every other permission present in the master's group. The name-based cascades (Edit -> View custom field values, and the reverse revoke) remain constant since they are not derivable from group membership. Update the master/wildcard integration assertions to compare against the live contributor permission set instead of a hardcoded count of 7, and add a unit test verifying the cascade adapts when a permission (id 25) is absent. Co-authored-by: Cursor <cursoragent@cursor.com>
added team admin permissions grant/revoke
fix in team permissions logging
removed deprecated functions
updated changelog
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.
No description provided.