Sanity Library Reference Docs
    Preparing search index...

    Variable useCheckPermissionsConst

    useCheckPermissions: <Permission extends string>(
        resourceType: AccessResourceType,
        resourceId: string,
        permissions: Permission[],
    ) => FetcherHookResult<Record<Permission, boolean>> = ...

    Checks whether the current user holds the given permissions on a resource.

    The hook suspends until the first fetch succeeds, so data is always present. data maps each requested permission to whether the user has it — keyed by exactly the permission strings you passed.

    Type declaration