apexJCL / casl-django-nuxt

Nuxt.JS module that generates default rules based on routes of your app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

casl-django-nuxt module

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

Check out CASL

Generate CASL rules for navigation based on nuxt routes. To be used with casl-django

đź“– Release Notes

Features

The module features autogeneration of default navigation routes, creating a json fixture that you can load in your django project to get going with default rules you can assign to your users.

Setup

  • Add casl-django-nuxt dependency using yarn or npm to your project
  • Add casl-django-nuxt to modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    'casl-django-nuxt',

    // With options
    ['casl-django-nuxt', { /* module options */ }],
 ]
}

Usage

  • Add casl-django-nuxt to your modules
  • Build your project with yarn run build

This will generate a json file called rules.json inside dist/_nuxt, copy that to your Django app fixtures folder and load it.

{
  modules: [
    'casl-django-nuxt',
    // Or with more options
    [
      'casl-django-nuxt', 
      {
        initialPK: 12,
        model: 'myApp.CustomPermissionModel',
        subject: 'myNavSubject'
      }
    ]
  ]
}

Development

  • Clone this repository
  • Install dependencies using yarn install or npm install
  • Start development server using npm run dev

License

MIT License

Copyright (c) José Carlos López carlos@nopalcreativa.com

About

Nuxt.JS module that generates default rules based on routes of your app.

License:MIT License


Languages

Language:JavaScript 99.1%Language:Vue 0.9%