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

(cherry picked from commit 224b062cac)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-08-04 14:34:29 +02:00
committed by GitHub
co-authored by Jack Westbrook
parent 9a89e0c157
commit db240265ff
@@ -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>;
}