Skip to content
Snippets Groups Projects
Unverified Commit 8f48090a authored by Alexander Lesnenko's avatar Alexander Lesnenko Committed by GitHub
Browse files

remove misleading permissions tooltip (#22436)


* remove misleading permissions tooltip

* Update enterprise/frontend/src/metabase-enterprise/feature_level_permissions/permission-management/download-permission.ts

Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
parent c4110255
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,19 @@ import {
import { getGroupFocusPermissionsUrl } from "metabase/admin/permissions/utils/urls";
import { PLUGIN_ADVANCED_PERMISSIONS } from "metabase/plugins";
export const DOWNLOAD_PERMISSION_REQUIRES_DATA_ACCESS = t`Download results access requires full data access.`;
export const UNABLE_TO_DOWNLOAD_RESULTS = t`Groups with Block data access can't download results`;
const getTooltipMessage = (isAdmin: boolean, isBlockedAccess: boolean) => {
if (isAdmin) {
return UNABLE_TO_CHANGE_ADMIN_PERMISSIONS;
}
if (isBlockedAccess) {
return UNABLE_TO_DOWNLOAD_RESULTS;
}
return null;
};
export const DOWNLOAD_PERMISSION_OPTIONS = {
none: {
......@@ -111,6 +123,11 @@ export const buildDownloadPermission = (
isAdmin ||
PLUGIN_ADVANCED_PERMISSIONS.isBlockPermission(dataAccessPermissionValue);
const disabledTooltip = getTooltipMessage(
isAdmin,
PLUGIN_ADVANCED_PERMISSIONS.isBlockPermission(dataAccessPermissionValue),
);
const warning = getPermissionWarning(
value,
defaultGroupValue,
......@@ -135,15 +152,11 @@ export const buildDownloadPermission = (
permission: "download",
type: "download",
isDisabled,
disabledTooltip,
value,
warning,
confirmations,
isHighlighted: isAdmin,
disabledTooltip: isAdmin
? UNABLE_TO_CHANGE_ADMIN_PERMISSIONS
: isDisabled
? DOWNLOAD_PERMISSION_REQUIRES_DATA_ACCESS
: null,
options: [
DOWNLOAD_PERMISSION_OPTIONS.none,
...(hasChildEntities ? [DOWNLOAD_PERMISSION_OPTIONS.controlled] : []),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment