You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Get an Audit Log Export. The URL will expire after 10 minutes. If the export is needed again at a later time, refetching the export will regenerate the URL.
91
91
* @param auditLogExportId - The unique ID of the Audit Log Export.
const{ data }=awaitthis.workos.get<EnvironmentRoleListResponse>(
@@ -127,7 +133,7 @@ export class Authorization {
127
133
* Get an environment role by its slug.
128
134
* @param slug - The slug of the environment role.
129
135
* @example "admin"
130
-
* @returns {Role}
136
+
* @returns {Promise<EnvironmentRole>}
131
137
* @throws {AuthorizationException} 403
132
138
* @throws {NotFoundException} 404
133
139
*/
@@ -145,7 +151,7 @@ export class Authorization {
145
151
* @param slug - The slug of the environment role.
146
152
* @example "admin"
147
153
* @param payload - The request body.
148
-
* @returns {Role}
154
+
* @returns {Promise<EnvironmentRole>}
149
155
* @throws {BadRequestException} 400
150
156
* @throws {AuthorizationException} 403
151
157
* @throws {NotFoundException} 404
@@ -163,13 +169,13 @@ export class Authorization {
163
169
}
164
170
165
171
/**
166
-
* Add a permission to an environment role
172
+
* Set permissions for an environment role
167
173
*
168
-
* Add a single permission to an environment role. If the permission is already assigned to the role, this operation has no effect.
174
+
* Replace all permissions on an environment role with the provided list.
169
175
* @param slug - The slug of the environment role.
170
176
* @example "admin"
171
-
* @param payload - Object containing slug.
172
-
* @returns {Role}
177
+
* @param payload - Object containing permissions.
178
+
* @returns {Promise<EnvironmentRole>}
173
179
* @throws {BadRequestException} 400
174
180
* @throws {AuthorizationException} 403
175
181
* @throws {NotFoundException} 404
@@ -187,13 +193,13 @@ export class Authorization {
187
193
}
188
194
189
195
/**
190
-
* Set permissions for an environment role
196
+
* Add a permission to an environment role
191
197
*
192
-
* Replace all permissions on an environment role with the provided list.
198
+
* Add a single permission to an environment role. If the permission is already assigned to the role, this operation has no effect.
193
199
* @param slug - The slug of the environment role.
194
200
* @example "admin"
195
-
* @param payload - Object containing permissions.
196
-
* @returns {Role}
201
+
* @param payload - Object containing slug.
202
+
* @returns {Promise<EnvironmentRole>}
197
203
* @throws {BadRequestException} 400
198
204
* @throws {AuthorizationException} 403
199
205
* @throws {NotFoundException} 404
@@ -217,7 +223,7 @@ export class Authorization {
217
223
* @param organizationId - The ID of the organization.
218
224
* @example "org_01EHZNVPK3SFK441A1RGBFSHRT"
219
225
* @param payload - Object containing name.
220
-
* @returns {Role}
226
+
* @returns {Promise<OrganizationRole>}
221
227
* @throws {BadRequestException} 400
222
228
* @throws {AuthorizationException} 403
223
229
* @throws {NotFoundException} 404
@@ -241,7 +247,7 @@ export class Authorization {
241
247
* Get a list of all roles that apply to an organization. This includes both environment roles and organization-specific roles, returned in priority order.
242
248
* @param organizationId - The ID of the organization.
243
249
* @example "org_01EHZNVPK3SFK441A1RGBFSHRT"
244
-
* @returns {RoleList}
250
+
* @returns {Promise<RoleList>}
245
251
* @throws {AuthorizationException} 403
246
252
* @throws {NotFoundException} 404
247
253
*/
@@ -263,7 +269,7 @@ export class Authorization {
263
269
* @example "org_01EHZNVPK3SFK441A1RGBFSHRT"
264
270
* @param slug - The slug of the role.
265
271
* @example "org-billing-admin"
266
-
* @returns {Role}
272
+
* @returns {Promise<Role>}
267
273
* @throws {AuthorizationException} 403
268
274
* @throws {NotFoundException} 404
269
275
*/
@@ -286,7 +292,7 @@ export class Authorization {
286
292
* @param slug - The slug of the role.
287
293
* @example "org-billing-admin"
288
294
* @param payload - The request body.
289
-
* @returns {Role}
295
+
* @returns {Promise<OrganizationRole>}
290
296
* @throws {BadRequestException} 400
291
297
* @throws {AuthorizationException} 403
292
298
* @throws {NotFoundException} 404
@@ -312,7 +318,7 @@ export class Authorization {
312
318
* @example "org_01EHZNVPK3SFK441A1RGBFSHRT"
313
319
* @param slug - The slug of the role.
314
320
* @example "org-admin"
315
-
* @returns {void}
321
+
* @returns {Promise<void>}
316
322
* @throws {BadRequestException} 400
317
323
* @throws {AuthorizationException} 403
318
324
* @throws {NotFoundException} 404
@@ -390,7 +396,7 @@ export class Authorization {
390
396
* @example "org-admin"
391
397
* @param permissionSlug - The slug of the permission to remove.
392
398
* @example "documents:read"
393
-
* @returns {void}
399
+
* @returns {Promise<void>}
394
400
* @throws {AuthorizationException} 403
395
401
* @throws {NotFoundException} 404
396
402
*/
@@ -409,7 +415,7 @@ export class Authorization {
409
415
*
410
416
* Create a new permission in your WorkOS environment. The permission can then be assigned to environment roles and organization roles.
411
417
* @param payload - Object containing slug, name.
412
-
* @returns {Permission}
418
+
* @returns {Promise<Permission>}
413
419
* @throws {BadRequestException} 400
414
420
* @throws {NotFoundException} 404
415
421
* @throws {ConflictException} 409
@@ -431,7 +437,7 @@ export class Authorization {
431
437
*
432
438
* Get a list of all permissions in your WorkOS environment.
* @deprecated Use `workos.permissions.list()` instead.
437
443
*/
@@ -458,7 +464,7 @@ export class Authorization {
458
464
* Retrieve a permission by its unique slug.
459
465
* @param slug - A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks.
460
466
* @example "documents:read"
461
-
* @returns {AuthorizationPermission}
467
+
* @returns {Promise<Permission>}
462
468
* @throws {NotFoundException} 404
463
469
* @deprecated Use `workos.permissions.find()` instead.
464
470
*/
@@ -476,7 +482,7 @@ export class Authorization {
476
482
* @param slug - A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks.
477
483
* @example "documents:read"
478
484
* @param payload - The request body.
479
-
* @returns {AuthorizationPermission}
485
+
* @returns {Promise<Permission>}
480
486
* @throws {AuthorizationException} 403
481
487
* @throws {NotFoundException} 404
482
488
* @throws {UnprocessableEntityException} 422
@@ -499,7 +505,7 @@ export class Authorization {
499
505
* Delete an existing permission. System permissions cannot be deleted.
500
506
* @param slug - A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks.
501
507
* @example "documents:read"
502
-
* @returns {void}
508
+
* @returns {Promise<void>}
503
509
* @throws {AuthorizationException} 403
504
510
* @throws {NotFoundException} 404
505
511
* @deprecated Use `workos.permissions.delete()` instead.
@@ -514,7 +520,7 @@ export class Authorization {
514
520
* Retrieve the details of an authorization resource by its ID.
515
521
* @param resourceId - The ID of the authorization resource.
* Check if an organization membership has a specific permission on a resource. Supports identification by resource_id OR by resource_external_id + resource_type_slug.
* Returns all organization memberships that have a specific permission on a resource instance. This is useful for answering "Who can access this resource?".
0 commit comments