More Premium Hugo Themes Premium Nuxt Themes

Nuxt Permissions

Nuxt module for permission management

Nuxt Permissions

Nuxt module for permission management

Author Avatar Theme by dystcz
Github Stars Github Stars: 59
Last Commit Last Commit: Aug 29, 2023 -
First Commit Created: Dec 18, 2023 -
Nuxt Permissions screenshot

Overview

Nuxt Permissions is a package designed for integrating roles and permissions with a Nuxt application. It serves as a complementary solution for backend permissions and should not be relied upon as the sole solution. However, it is important to note that this package is currently in alpha version and is not suitable for use in production. The package is still a work in progress and may undergo changes in the future.

Features

  • Integration of roles and permissions with a Nuxt application
  • Use of usePermissions or useRoles composable to set user permissions or roles
  • Middleware usage with the ability to set permissions or roles in definePageMeta
  • Directives (v-can, v-can:not, v-role, v-role:not) for conditional rendering based on permissions or roles

Installation

To install Nuxt Permissions, follow these steps:

  1. Add the module to your nuxt.config.js or nuxt.config.ts file.
  2. Set the ssr property to false.
  3. Use the usePermissions or useRoles composable to set user permissions or roles.
  4. Set nuxt-permissions as middleware and add permissions or roles in definePageMeta for the desired pages.

Example:

import permissions from 'nuxt-permissions'

export default {
  modules: [
    permissions
  ],
  permissions: {
    permissions: ['access dashboard'],
    roles: ['admin']
  }
}

Summary

Nuxt Permissions is a package that allows for easy integration of roles and permissions with a Nuxt application. It provides a convenient way to set user permissions or roles, and offers middleware usage and directives for conditional rendering based on permissions or roles. However, it is important to note that this package is still in alpha version and should not be used in production.