Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/authorization/authorization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2418,13 +2418,12 @@ describe('Authorization', () => {
const result =
await workos.authorization.listEffectivePermissionsByExternalId({
organizationMembershipId: testOrgMembershipId,
organizationId: testOrgId,
resourceTypeSlug: 'document',
externalId: 'doc-456',
});

expect(fetchURL()).toContain(
`/authorization/organizations/${testOrgId}/resources/document/doc-456/organization_memberships/${testOrgMembershipId}/permissions`,
`/authorization/organization_memberships/${testOrgMembershipId}/resources/document/doc-456/permissions`,
);
expect(result.object).toEqual('list');
expect(result.data).toHaveLength(2);
Expand Down Expand Up @@ -2453,7 +2452,6 @@ describe('Authorization', () => {

await workos.authorization.listEffectivePermissionsByExternalId({
organizationMembershipId: testOrgMembershipId,
organizationId: testOrgId,
resourceTypeSlug: 'document',
externalId: 'doc-456',
limit: 10,
Expand All @@ -2473,7 +2471,6 @@ describe('Authorization', () => {

await workos.authorization.listEffectivePermissionsByExternalId({
organizationMembershipId: testOrgMembershipId,
organizationId: testOrgId,
resourceTypeSlug: 'document',
externalId: 'doc-456',
before: 'perm_cursor789',
Expand All @@ -2491,7 +2488,6 @@ describe('Authorization', () => {

await workos.authorization.listEffectivePermissionsByExternalId({
organizationMembershipId: testOrgMembershipId,
organizationId: testOrgId,
resourceTypeSlug: 'document',
externalId: 'doc-456',
});
Expand Down
9 changes: 2 additions & 7 deletions src/authorization/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1134,13 +1134,8 @@ export class Authorization {
async listEffectivePermissionsByExternalId(
options: ListEffectivePermissionsByExternalIdOptions,
): Promise<AutoPaginatable<Permission>> {
const {
organizationMembershipId,
organizationId,
resourceTypeSlug,
externalId,
} = options;
const endpoint = `/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}/organization_memberships/${organizationMembershipId}/permissions`;
const { organizationMembershipId, resourceTypeSlug, externalId } = options;
const endpoint = `/authorization/organization_memberships/${organizationMembershipId}/resources/${resourceTypeSlug}/${externalId}/permissions`;
const serializedOptions = serializeListEffectivePermissionsOptions(options);
return new AutoPaginatable(
await fetchAndDeserialize<PermissionResponse, Permission>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { PaginationOptions } from '../../common/interfaces/pagination-options.in

export interface ListEffectivePermissionsByExternalIdOptions extends PaginationOptions {
organizationMembershipId: string;
organizationId: string;
resourceTypeSlug: string;
externalId: string;
}
Loading