Skip to main content

Function.roleSatisfies

function roleSatisfies(role: "owner" | "admin" | "editor" | "viewer", required: Permissions): boolean;

Whether a role covers every requested permission.

better-auth's own hasPermission endpoint resolves the caller from a session cookie, so it cannot answer for a principal that has no session — an OAuth access token bearer, for instance (cf. ADR 97). This evaluates the same roleStatements table directly, from a role already resolved elsewhere.

Parameters​

ParameterType
role"owner"
requiredPermissions

Returns​

boolean