New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

v-role

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v-role

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
16
220%
Maintainers
1
Weekly downloads
 
Created
Source

v-role - vue role manager

npm version npm downloads Github Actions CI License

v-role makes it easy to manage roles and permissions.

⚙️ Features

  • Use via directives or component
  • Handle routes access
  • Support Composition API and Options API
  • First class Typescript support

📖 Read more

✨ Quick setup

  • Install v-role dependency to your project
pnpm install v-role # or npm install v-role
  • Import plugin and pass it to the app:
import { createApp } from "vue";
import { VRolePlugin } from "v-role";
import App from "./App.vue";

const app = createApp(App);
app.use(VRolePlugin);

app.mount("#app");
  • Set up roles and permissions
import { useRole } from "v-role";

const { setRoles, setPermissions } = useRole();
setRoles(["admin", "moderator"]);
setPermissions(["can-write", "can-edit"]);
  • Use v-role or v-permission directives
<div v-role="'admin'" v-permission:any="['can-write', 'can-read']">
  You can write or read!
</div>

🔒 License

MIT License

Keywords

vue.js

FAQs

Package last updated on 09 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts