Skip to content
Snippets Groups Projects
Unverified Commit eff2be2a authored by shaun's avatar shaun Committed by GitHub
Browse files

Fix warning copy when changing table permissions (#36243)

parent e2e6f138
Branches
Tags
No related merge requests found
......@@ -417,7 +417,7 @@ describe("scenarios > admin > permissions", { tags: "@OSS" }, () => {
);
modal().within(() => {
cy.findByText("Change access to this database to limited?");
cy.findByText("Change access to this database to granular?");
cy.button("Change").click();
});
......@@ -531,7 +531,7 @@ describe("scenarios > admin > permissions", { tags: "@OSS" }, () => {
);
modal().within(() => {
cy.findByText("Change access to this database to limited?");
cy.findByText("Change access to this database to granular?");
cy.button("Change").click();
});
......@@ -616,7 +616,7 @@ describeEE("scenarios > admin > permissions", () => {
modifyPermission("All Users", DATA_ACCESS_PERMISSION_INDEX, "Sandboxed");
modal().within(() => {
cy.findByText("Change access to this database to limited?");
cy.findByText("Change access to this database to granular?");
cy.button("Change").click();
});
......
......@@ -11,6 +11,10 @@ import type {
GroupsPermissions,
ConcreteTableId,
} from "metabase-types/api";
import {
isSchemaEntityId,
isTableEntityId,
} from "metabase/admin/permissions/utils/data-entity-id";
import type Database from "metabase-lib/metadata/Database";
import type { EntityId } from "../types";
......@@ -103,8 +107,14 @@ export function getControlledDatabaseWarningModal(
getSchemasPermission(permissions, groupId, entityId, "data") !==
"controlled"
) {
const [entityType, entityTypePlural] = isTableEntityId(entityId)
? [t`table`, t`tables`]
: isSchemaEntityId(entityId)
? [t`schema`, t`schemas`]
: [t`entity`, t`entities`];
return {
title: t`Change access to this database to limited?`,
title: t`Change access to this database to granular?`,
message: t`Just letting you know that changing the permission setting on this ${entityType} will also update the database permission setting to “Granular” to reflect that some of the database’s ${entityTypePlural} have different permission settings.`,
confirmButtonText: t`Change`,
cancelButtonText: t`Cancel`,
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment