Skip to content

Develop - #883

Merged
VaghinakDev merged 22 commits into
masterfrom
develop
Aug 16, 2026
Merged

Develop#883
VaghinakDev merged 22 commits into
masterfrom
develop

Conversation

@VaghinakDev

Copy link
Copy Markdown
Contributor

No description provided.

Narek Mkhitaryan and others added 22 commits July 14, 2026 16:33
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
@VaghinakDev
VaghinakDev merged commit 21b0ea3 into master Aug 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants