checkAuthorization

fun checkAuthorization(role: String? = null, permission: String? = null, feature: String? = null, plan: String? = null, reverification: ReverificationConfig? = null): Boolean

Returns whether the user has role or permission in the Active Organization, has the Billing feature or is subscribed to the Billing plan, and reverified within reverification.

Pass one of role, permission, feature, or plan, optionally with reverification, or reverification alone. When you pass several, all of them must pass. Returns false when there is no user or no condition is passed, and for role and permission when there is no Active Organization. Prefix a feature or plan slug with user: or org: to check one payer only. A Subscription change is reflected in feature and plan checks after the session token refreshes.