nest-access-control | Role and Attribute based Access Control for Nestjs 🔐 | Authorization library

 by   nestjsx TypeScript Version: 3.1.0 License: MIT

kandi X-RAY | nest-access-control Summary

kandi X-RAY | nest-access-control Summary

nest-access-control is a TypeScript library typically used in Security, Authorization applications. nest-access-control has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

TL;DR: recently our system was needing to have a Control Panel, so you can control, and monitor every thing from there, and it was really really needing some Role based access control system, so i build this module for that, it is really cool, so i'd love to share it with you, and any PR are more than welcome :heart:. This module is built on top of onury's accesscontrol library here is some of it's Core Features. In this module you will have all these features out of the box, but in nest-ish way.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              nest-access-control has a medium active ecosystem.
              It has 923 star(s) with 68 fork(s). There are 19 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 11 open issues and 25 have been closed. On average issues are closed in 45 days. There are 21 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of nest-access-control is 3.1.0

            kandi-Quality Quality

              nest-access-control has 0 bugs and 0 code smells.

            kandi-Security Security

              nest-access-control has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              nest-access-control code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              nest-access-control is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              nest-access-control releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nest-access-control
            Get all kandi verified functions for this library.

            nest-access-control Key Features

            No Key Features are available at this moment for nest-access-control.

            nest-access-control Examples and Code Snippets

            No Code Snippets are available at this moment for nest-access-control.

            Community Discussions

            Trending Discussions on nest-access-control

            QUESTION

            NestJS strategy for excluding fields for different user roles?
            Asked 2020-May-28 at 09:11

            Let's say I have a base entity, ShopsEntity, that has a bunch of fields along with a secret property:

            ...

            ANSWER

            Answered 2020-May-28 at 09:11

            With class-transformer, you can use the groups property to expose properties only for certain groups/roles:

            Source https://stackoverflow.com/questions/58799209

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install nest-access-control

            See example folder for the more code. We need to build a Video service so users can share there videos with others, but we need some admins to control these videos. Pro Tip :+1: : Keep all roles organized and in one file e,g: app.roles.ts.
            NPM:
            Yarn:
            Let's first define our roles: To build our roles we will need the RolesBuilder class, it extends the AccessControl class from accesscontrol package. // app.roles.ts export enum AppRoles { USER_CREATE_ANY_VIDEO = 'USER_CREATE_ANY_VIDEO', ADMIN_UPDATE_OWN_VIDEO = 'ADMIN_UPDATE_OWN_VIDEO', } export const roles: RolesBuilder = new RolesBuilder(); roles .grant(AppRoles.USER_CREATE_ANY_VIDEO) // define new or modify existing role. also takes an array. .createOwn('video') // equivalent to .createOwn('video', ['*']) .deleteOwn('video') .readAny('video') .grant(AppRoles.ADMIN_UPDATE_OWN_VIDEO) // switch to another role without breaking the chain .extend(AppRoles.USER_CREATE_ANY_VIDEO) // inherit role capabilities. also takes an array .updateAny('video', ['title']) // explicitly defined attributes .deleteAny('video');
            Next let's use AccessControlModule in our Root module:

            Support

            You are welcome with this project for contributing, just make a PR.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i nest-access-control

          • CLONE
          • HTTPS

            https://github.com/nestjsx/nest-access-control.git

          • CLI

            gh repo clone nestjsx/nest-access-control

          • sshUrl

            git@github.com:nestjsx/nest-access-control.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Authorization Libraries

            casbin

            by casbin

            RxPermissions

            by tbruyelle

            opa

            by open-policy-agent

            cancan

            by ryanb

            Try Top Libraries by nestjsx

            crud

            by nestjsxTypeScript

            nestjs-typeorm-paginate

            by nestjsxTypeScript

            nestjs-config

            by nestjsxTypeScript

            nest-router

            by nestjsxTypeScript

            nestjs-flub

            by nestjsxHTML