Skip to main content

Overview

useSpacePermissions is a utility hook that computes derived permission flags from a user’s raw membership permissions and the space’s permission settings. It is used internally by useSpaceData and exposed for cases where you need to compute permissions outside of a SpaceProvider.
In most cases, you should use useSpace instead — it exposes isMember, isAdmin, canPost, etc. directly. Use useSpacePermissions only when working outside a SpaceProvider context.

Usage Example

Parameters

SpaceMemberPermissions | null | undefined
required
The raw membership permissions object from the space. null or undefined if the user is not a member.
"anyone" | "members" | "admins"
required
The space’s posting permission setting.
"anyone" | "members"
The space’s reading permission setting. Defaults to "anyone".

Returns

boolean
Whether the user is an active member.
boolean
Whether the user is an admin.
boolean
Whether the user is a moderator.
boolean
Whether the user can post, given the space’s posting permission and their membership status.
boolean
Whether the user can moderate content.
boolean
Whether the user can read content, given the space’s reading permission.
boolean
Whether the user has a pending membership.
boolean
Whether the user is banned.