Catalog: Fix InstallControls for externally managed users (#37531)

This commit is contained in:
Jack Westbrook 2021-08-04 13:52:01 +02:00 committed by GitHub
parent d48febee75
commit 224b062cac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,8 +94,9 @@ export const InstallControls = ({ plugin, isInflight, hasUpdate, isInstalled, ha
);
}
if (!hasPermission) {
const message = `You need server admin privileges to ${isInstalled ? 'uninstall' : 'install'} this plugin.`;
if (!hasPermission && !isExternallyManaged) {
const pluginStatus = isInstalled ? 'uninstall' : hasUpdate ? 'update' : 'install';
const message = `You do not have permission to ${pluginStatus} this plugin.`;
return <div className={styles.message}>{message}</div>;
}