diff --git a/packages/editor/src/components/post-actions/set-as-homepage.js b/packages/editor/src/components/post-actions/set-as-homepage.js index 671906575b4123..cb67e251ed58c2 100644 --- a/packages/editor/src/components/post-actions/set-as-homepage.js +++ b/packages/editor/src/components/post-actions/set-as-homepage.js @@ -122,8 +122,13 @@ const SetAsHomepageModal = ( { items, closeModal } ) => { export const useSetAsHomepageAction = () => { const { pageOnFront, pageForPosts } = useSelect( ( select ) => { - const { getEntityRecord } = select( coreStore ); - const siteSettings = getEntityRecord( 'root', 'site' ); + const { getEntityRecord, canUser } = select( coreStore ); + const siteSettings = canUser( 'read', { + kind: 'root', + name: 'site', + } ) + ? getEntityRecord( 'root', 'site' ) + : undefined; return { pageOnFront: siteSettings?.page_on_front, pageForPosts: siteSettings?.page_for_posts, diff --git a/packages/editor/src/components/post-actions/set-as-posts-page.js b/packages/editor/src/components/post-actions/set-as-posts-page.js index 67c42a7991fe45..830c2cac734f1f 100644 --- a/packages/editor/src/components/post-actions/set-as-posts-page.js +++ b/packages/editor/src/components/post-actions/set-as-posts-page.js @@ -118,8 +118,14 @@ const SetAsPostsPageModal = ( { items, closeModal } ) => { export const useSetAsPostsPageAction = () => { const { pageOnFront, pageForPosts } = useSelect( ( select ) => { - const { getEntityRecord } = select( coreStore ); - const siteSettings = getEntityRecord( 'root', 'site' ); + const { getEntityRecord, canUser } = select( coreStore ); + const siteSettings = canUser( 'read', { + kind: 'root', + name: 'site', + } ) + ? getEntityRecord( 'root', 'site' ) + : undefined; + return { pageOnFront: siteSettings?.page_on_front, pageForPosts: siteSettings?.page_for_posts,