Vue Permission Inertia

Current Version License

This package helps you to retrieve permissions from your laravel application with Inertia.js as dependency.

Requirements

  • Vue3
  • Inertia.js

Setup

Install the package

npm i vue-permission-inertia

Basic Usage

can

<span v-can="'myPermissionIWantToCheck'"></span>

Or as property

<span v-if="$can('myPermissionIWantToCheck')"></span>

Checks if the user has this permission.

canAny

<span v-canAny="['myPermissionIWantToCheck', 'mySecondPermissionIWantToCheck']"></span>

Or as property

<span v-if="$can('myPermissionIWantToCheck', 'mySecondPermissionIWantToCheck')"></span>

This checks if the user has at least one permission.

canAll

<span v-canAny="['myPermissionIWantToCheck', 'mySecondPermissionIWantToCheck']"></span>

Or as property

<span v-if="$canAll('myPermissionIWantToCheck', 'mySecondPermissionIWantToCheck')"></span>

This checks if the user has all provided permissions.