laravel-enso / tables

Bulma themed, VueJS powered Datatable with server-side loading and JSON template setup
https://www.laravel-enso.com/examples/table
632 stars 77 forks source link

Hide custom button if route is not available #242

Closed mauthi closed 3 years ago

mauthi commented 3 years ago

This is a question.

Prerequisites

Description

For my customers table I have defined an additional row button:

{
        "type": "row",
        "icon": "dollar-sign",
        "class": "is-row-button",
        "event": "load-invoices"
    }

The event method is the following:

loadInvoices(row) {
            this.$router.push({
                name: 'billing.invoices.index',
                params: {
                    id: row.id,
                    filterType: 'customer',
                },
            });
        },

Now I have the problem, that the button should only be visible for users who have access to the billing.invoices.index route.

My question: Is there a possibility to show the button only if user has right to view billing.invoices.index?

Thx in advance for your help.

aocneanu commented 3 years ago

Hi @mauthi ,

Look at the data-import table (json & builder)

mauthi commented 3 years ago

Thx - works perfect.