FGA_4: list/assign/remove role, remove roleAssginment#570
Open
swaroopAkkineniWorkos wants to merge 4 commits intoENT-5224-python-sdk-for-fga-worktree-fuck-aroundfrom
Open
FGA_4: list/assign/remove role, remove roleAssginment#570swaroopAkkineniWorkos wants to merge 4 commits intoENT-5224-python-sdk-for-fga-worktree-fuck-aroundfrom
swaroopAkkineniWorkos wants to merge 4 commits intoENT-5224-python-sdk-for-fga-worktree-fuck-aroundfrom
Conversation
Author
|
@greptile review |
Contributor
Greptile SummaryAdds four new methods to the Authorization module for managing role assignments: listing, assigning, and removing roles from organization memberships. Implementation includes both sync and async versions, supports resource identification by ID or external ID, and includes proper pagination support.
Note: PR title contains typo "roleAssginment" (should be "roleAssignment") Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Client] --> B{Operation Type}
B -->|List| C[list_role_assignments]
C --> D[GET /authorization/organization_memberships/:id/role_assignments]
D --> E[Returns paginated RoleAssignment list]
B -->|Assign| F[assign_role]
F --> G{Resource Identifier Type}
G -->|By ID| H[POST with resource_id]
G -->|By External ID| I[POST with resource_external_id + resource_type_slug]
H --> J[Returns RoleAssignment]
I --> J
B -->|Remove by Role| K[remove_role]
K --> L{Resource Identifier Type}
L -->|By ID| M[DELETE with resource_id in body]
L -->|By External ID| N[DELETE with external_id + type_slug in body]
M --> O[Returns None]
N --> O
B -->|Remove by ID| P[remove_role_assignment]
P --> Q[DELETE /role_assignments/:assignment_id]
Q --> O
Last reviewed commit: 8796fc2 |
Comment on lines
+1
to
+15
| from typing import Union | ||
|
|
||
| from typing_extensions import TypedDict | ||
|
|
||
|
|
||
| class ResourceIdentifierById(TypedDict): | ||
| resource_id: str | ||
|
|
||
|
|
||
| class ResourceIdentifierByExternalId(TypedDict): | ||
| resource_external_id: str | ||
| resource_type_slug: str | ||
|
|
||
|
|
||
| ResourceIdentifier = Union[ResourceIdentifierById, ResourceIdentifierByExternalId] |
There was a problem hiding this comment.
this is duplicate of what is in https://github.com/workos/workos-python/pull/568/changes#r2842020033, can consolidate
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.
Description
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.