-
hi everyone please help me i made excel report button on the grid and i want to specify a permission for that button so that only the admin can see the reports note : i allready make class of permission i just need to give access to that button |
Beta Was this translation helpful? Give feedback.
Answered by
luongnv6
Feb 17, 2021
Replies: 1 comment
-
This is code in grid.ts protected getButtons() {
var buttons = super.getButtons();
if (Q.Authorization.hasPermission("permissionName"))
buttons.push({
title: 'Print Report',
cssClass: 'export-pdf-button',
onClick: () => {
Common.ReportHelper.execute({
reportKey: "PowerInventory.Report",
params: {
Request: this.view.params as Serenity.ListRequest
}
});
}
});
return buttons;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
samaremad
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is code in grid.ts