Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue with non-admins being able to see the plugin menu item #21657

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* [*] Resolve the unresponsiveness of the compliance popover on iPhone SE devices when large fonts are enabled. [#21609]
* [*] Block Editor: Prevent crash from invalid media URLs [https://github.com/WordPress/gutenberg/pull/54834]
* [*] Block Editor: Limit inner blocks nesting depth to avoid call stack size exceeded crash [https://github.com/WordPress/gutenberg/pull/54382]
* [*] Fix an issue with non-admins being able to see the plugin menu on the Atomic sites [https://github.com/wordpress-mobile/WordPress-iOS/pull/21657]
* [**] Block Editor: Fallback to Twitter provider when embedding X URLs [https://github.com/WordPress/gutenberg/pull/54876]

23.3
Expand Down
8 changes: 3 additions & 5 deletions WordPress/Classes/Models/Blog.m
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ - (BOOL)supports:(BlogFeature)feature
case BlogFeaturePlans:
return [self isHostedAtWPcom] && [self isAdmin];
case BlogFeaturePluginManagement:
return [self supportsPluginManagement];
return [self supportsPluginManagement] && [self isAdmin];
case BlogFeatureJetpackImageSettings:
return [self supportsJetpackImageSettings];
case BlogFeatureJetpackSettings:
Expand Down Expand Up @@ -686,8 +686,7 @@ - (BOOL)supportsPluginManagement

BOOL isTransferrable = self.isHostedAtWPcom
&& self.hasBusinessPlan
&& self.siteVisibility != SiteVisibilityPrivate
&& self.isAdmin;
&& self.siteVisibility != SiteVisibilityPrivate;

BOOL supports = isTransferrable || hasRequiredJetpack;

Expand All @@ -696,8 +695,7 @@ - (BOOL)supportsPluginManagement
if(!supports && !self.account){
supports = !self.isHostedAtWPcom
&& self.wordPressOrgRestApi
&& [self hasRequiredWordPressVersion:@"5.5"]
&& self.isAdmin;
&& [self hasRequiredWordPressVersion:@"5.5"];
}

return supports;
Expand Down