Skip to content
Snippets Groups Projects
Unverified Commit 810e7a61 authored by Kyle Doherty's avatar Kyle Doherty Committed by GitHub
Browse files

check can_write when displaying dashboard header buttons (#9047)

* check can_write when displaying header buttons

* check can_write when displaying header buttons

* don't hide duplicate
parent 80d057e2
No related branches found
No related tags found
No related merge requests found
......@@ -196,7 +196,7 @@ export default class DashboardHeader extends Component {
location,
} = this.props;
const isEmpty = !dashboard || dashboard.ordered_cards.length === 0;
const canEdit = isEditable && !!dashboard;
const canEdit = dashboard.can_write && isEditable && !!dashboard;
const isPublicLinksEnabled = MetabaseSettings.get("public_sharing");
const isEmbeddingEnabled = MetabaseSettings.get("embedding");
......@@ -314,16 +314,18 @@ export default class DashboardHeader extends Component {
}
if (!isFullscreen && !isEditing) {
buttons.push(
<Tooltip key="new-dashboard" tooltip={t`Move dashboard`}>
<Link
to={location.pathname + "/move"}
data-metabase-event={"Dashboard;Move"}
>
<Icon className="text-brand-hover" name="move" size={18} />
</Link>
</Tooltip>,
);
if (canEdit) {
buttons.push(
<Tooltip key="new-dashboard" tooltip={t`Move dashboard`}>
<Link
to={location.pathname + "/move"}
data-metabase-event={"Dashboard;Move"}
>
<Icon className="text-brand-hover" name="move" size={18} />
</Link>
</Tooltip>,
);
}
buttons.push(
<Tooltip key="copy-dashboard" tooltip={t`Duplicate dashboard`}>
<Link
......
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