🐛 Fixed error preventing publish for non-Admin staff users

refs e3db911108

Contributors/Authors/Editors do not have permissions to fetch members so the request to fetch a member count when checking member host limits fails and blocked publishing because it was treated like a failed limit check.

- prevented the up-front limit check from running for non-Admin staff users. Publishing will still fail for other users if the site is over the hosting plan members limit but the error will be shown later in the flow when the actual publish request is made.
This commit is contained in:
Kevin Ansfield 2022-09-27 13:19:02 +01:00
parent ddb9c1b30c
commit 5513cfbbdb

View File

@ -383,6 +383,11 @@ export default class PublishOptions {
}
async _checkPublishingLimit() {
// non-admin users cannot fetch members count so we can't error at this stage for them
if (!this.user.isAdmin) {
return;
}
try {
if (this.limit.limiter?.isLimited('members')) {
await this.limit.limiter.errorIfIsOverLimit('members');