sanity icon indicating copy to clipboard operation
sanity copied to clipboard

fix(core): disable scheduledPublishing and tasks if `/features` returns error

Open pedrobonamin opened this issue 5 months ago • 3 comments

Description

Some users have reported that they see the upsell ui even though the feature is enabled for the project. That is due to the features api returning an error if the user doesn't have the right permissions to query it.

This PR adds the same check for scheduledPublishing and tasks plugins. In comments we are currently doing that check here https://github.com/sanity-io/sanity/blob/edx-1599/packages/sanity/src/core/comments/hooks/useResolveCommentsEnabled.ts#L42-L43

What to review

Are this changes ok?

Testing

New tests have been introduced to guard this behavior.

Notes for release

Disable schedule publishing and tasks plugin if user doesn't have the right access.

pedrobonamin avatar Sep 17 '24 12:09 pedrobonamin