isAuthorizedSync
Checks whether the logged-in member is authorized to perform action on resourceId using the locally cached RBAC policy. No network request is made; returns false if no policy is cached yet.
Kotlin:
val allowed = StytchB2B.rbac.isAuthorizedSync(
resourceId = "documents",
action = "read",
)Content copied to clipboard
iOS:
let allowed = StytchB2B.rbac.isAuthorizedSync(resourceId: "documents", action: "read")Content copied to clipboard
React Native:
const allowed = StytchB2B.rbac.isAuthorizedSync("documents", "read")Content copied to clipboard
Return
true if the member is authorized; false otherwise or if no policy is cached.
Parameters
resourceId
The ID of the resource to check authorization for.
action
The action to check (e.g. "read", "write", "delete").