Coder Social home page Coder Social logo

nuxt-permissions's People

Contributors

carpad88 avatar kreejzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nuxt-permissions's Issues

Missing license

Could you please specify license for this project? otherwise can't be used by any public facing project. thanks

edit: I see it is specified in package.json, but still would be nice to set it on github as well.

Add composable to access roles or permissions

It would be great to have a composable that lets us access the roles or permissions to use it in our logic, for example, to check if a user can execute one function.

The directives are great for hiding or showing UI parts, but we are limited if we need to execute some specific condition.

For example, let's assume users can see the list of permissions, but if they don't have the permission update_permissions, they shouldn't switch the checkboxes, only see them. Something like the following

<input
  v-model="rolesAndPermissions[action]"
  type="checkbox"
  class="form-checkbox"
  :disabled="!user.permissions.includes('update_roles')"
/>

Screenshot 2023-05-01 at 14 19 24

Screenshot 2023-05-01 at 14 20 48

Adding page meta middleware 'nuxt-permissions' results in 404

Adding definePageMeta({ middleware: ['nuxt-permissions'] }) to a page, causes it to return with a 404 error. It does the same if I include my auth.global.ts as middleware (it is currently completely empty anyway). I've made sure to disable SSR.

It's a brand new project and that's pretty much all I've got so far. I'm really curious as to why this doesn't work.

package.json:

{
  "name": "nuxt-app",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "dev:host": "nuxt dev --host",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "dependencies": {
    "@formkit/auto-animate": "^0.8.1",
    "@formkit/nuxt": "^1.5.9",
    "@nuxt/image": "^1.3.0",
    "@pinia-plugin-persistedstate/nuxt": "^1.2.0",
    "@pinia/nuxt": "^0.5.1",
    "nuxt": "^3.10.3",
    "nuxt-permissions": "^0.2.4",
    "vue": "^3.4.19",
    "vue-router": "^4.3.0"
  },
  "devDependencies": {
    "@nuxt/fonts": "^0.0.1",
    "@nuxtjs/html-validator": "^1.6.0",
    "nuxt-icon": "^0.6.8",
    "sass": "^1.71.1"
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.