Skip to main content

Variable.roleSatisfies

const roleSatisfies: (role: Role, 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
roleRole
requiredPermissions

Returns​

boolean