isAuthorized
Refreshes the RBAC policy from the server, then checks whether the logged-in member is authorized to perform action on resourceId.
Kotlin:
val allowed = StytchB2B.rbac.isAuthorized(
resourceId = "documents",
action = "read",
)Content copied to clipboard
iOS:
let allowed = try await StytchB2B.rbac.isAuthorized(resourceId: "documents", action: "read")Content copied to clipboard
React Native:
const allowed = await StytchB2B.rbac.isAuthorized("documents", "read")Content copied to clipboard
Return
true if the member is authorized; false otherwise.
Parameters
resourceId
The ID of the resource to check authorization for.
action
The action to check (e.g. "read", "write", "delete").
Throws
if the coroutine is cancelled.