yasithdev opened a new pull request, #184:
URL: https://github.com/apache/airavata-portals/pull/184
## Summary
`SharedEntityViewSet` and `SharedEntitySerializer.get_hasSharingPermission`
ran on the Thrift sharing-registry / profile-service clients, so opening a
resource's **sharing dialog** blocked on the dead Thrift server's read-timeout.
This repoints entity sharing to the gRPC `sharing` (+ `iam`) facade.
## Changes
- **`SharedEntityViewSet`**: accessible-users/groups loads →
`request.airavata.sharing.get_all[_directly]_accessible_{users,groups}`;
share/revoke → `share_resource_with_{users,groups}` /
`revoke_sharing_of_resource_from_{users,groups}`; `_load_user_profile` →
`iam.get_user_profile_by_id` (+ new `grpc_adapters.user_profile`);
`_load_group` → `sharing.gm_get_group` (+ `grpc_adapters.group`).
- **`SharedEntitySerializer.get_hasSharingPermission`** → the existing gRPC
`user_has_access` helper.
- **Permission bridge**: the sharing facade takes the permission as the enum
**NAME** (e.g. `"READ"`), while the serializer renders the Thrift **int** via
`permissionType`. The viewset bridges with `ResourcePermissionType(value).name`
at the facade boundary and keeps the int in the returned dict — frontend
contract unchanged.
- **`grpc_adapters.user_profile`**: maps the protobuf `UserProfile` to the
Thrift attribute names the serializer reads (incl. the `State` /
`orginationAffiliation` / `labeledURI` quirks); nested
`nsfDemographics`/`customDashboard` render null.
## Testing
- `manage.py check` — green.
- A real `UserProfile` renders cleanly through `UserProfileSerializer` via
the new adapter (all 26 fields, no missing-attribute errors).
- The sharing facade calls accept the NAME permission and return live
results (`get_all_directly_accessible_users`/`groups` → `[]` for a nonexistent
entity, no error).
- Note: a fully populated sharing dialog needs a seeded shared entity, which
isn't creatable in the ephemeral dev backend (same limitation as group
seeding); the building blocks are each validated individually.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]