feat: Add resource_type_slug to createOrganizationRole to create resource-scoped custom roles#607
feat: Add resource_type_slug to createOrganizationRole to create resource-scoped custom roles#607
Conversation
…urce-scoped custom roles
Greptile SummaryThis PR adds Confidence Score: 5/5Safe to merge — changes are minimal, consistent across sync/async implementations and Protocol, and well-tested. Both parameters are purely additive and optional, backward compatibility is preserved, the Protocol and both concrete classes are updated in lockstep, and the new tests cover the new behaviour under the sync_and_async marker. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant Authorization
participant HTTPClient
participant WorkOSAPI
Caller->>Authorization: create_organization_role(org_id, name, slug?, resource_type_slug?)
Note over Authorization: Build JSON body:<br/>name (always)<br/>slug (if provided)<br/>description (if provided)<br/>resource_type_slug (if provided)
Authorization->>HTTPClient: POST /authorization/organizations/{org_id}/roles
HTTPClient->>WorkOSAPI: HTTP POST with JSON body
WorkOSAPI-->>HTTPClient: 201 OrganizationRole JSON
HTTPClient-->>Authorization: response dict
Authorization-->>Caller: OrganizationRole model
Reviews (1): Last reviewed commit: "feat: Add resource_type_slug to createOr..." | Re-trigger Greptile |
Also makes permission slug optional. If omitted, the service will create auto-generated slugs