Nest Access Control

screenshot of Nest Access Control
nestjs

Role and Attribute based Access Control for Nestjs

Overview

The Nest Access Control is a powerful helper module designed for creating a robust Role and Attribute-based Access Control (RBAC) system for NestJS applications. In response to the need for a structured control panel to manage permissions effectively, this module integrates seamlessly with the AccessControl library by onury, bringing an elegant solution to developers seeking to implement hierarchical permissions in their projects. Its rich feature set, coupled with a user-friendly API, makes it a compelling choice for anyone looking to enhance security and manage user roles efficiently.

This module stands out for its ease of use and high performance, offering decorators and a built-in guard that simplify the process of defining and checking user roles against access permissions. Whether you are building a video-sharing service or any other application requiring precise access control, Nest Access Control provides the necessary tools to ensure that permissions are enforced consistently and swiftly.

Features

  • Chainable API: Simplifies permission checks with an intuitive syntax, e.g., ac.can(role).create(resource).
  • Role Hierarchical Inheritance: Easily define roles that inherit permissions from other roles, enabling a streamlined structure.
  • Bulk Grant Definitions: Define multiple permissions at once from database results or one by one, enhancing flexibility.
  • Granular Permission Control: Grant or deny access using attribute definitions via glob notation, supporting nested objects for complex structures.
  • Data Filtering: Automatically filter data instances by the allowed attributes, ensuring users only see relevant information.
  • Resource Control: Manage access rights on own resources or any shared resources, providing versatility in permissions management.
  • Performance Optimized: Grants are stored in memory, making operations fast without the need for constant database queries.
  • TypeScript Support: Fully compatible with TypeScript, ensuring type safety and better developer experience in NestJS projects.
nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

gulp
Gulp

Gulp.js is an old but popular site building tool that automates various repetitive development tasks in web development, such as compiling Sass, minifying JavaScript, and optimizing images.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.