Skip to content

how to put permission on excel report button #5477

Answered by luongnv6
samaremad asked this question in Help
Discussion options

You must be logged in to vote

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;
        

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by samaremad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants