Access Granted

screenshot of Access Granted
rails

Multi-role and whitelist based authorization gem for Rails (and not only Rails!)

Overview

AccessGranted is an innovative authorization gem designed for Rails that replaces traditional solutions like CanCan, providing a more efficient and manageable approach to defining user permissions. With its lightweight design, averaging around 300 lines of code, AccessGranted focuses on enhancing performance without compromising usability. This makes it an attractive choice for developers looking to streamline their application’s permission handling while ensuring clean and readable code.

This gem stands out due to its ability to support roles and whitelists, positioning it as a forward-thinking tool that simplifies authorization processes. Whether you’re working with simple or complex applications, AccessGranted offers a framework-agnostic solution that guarantees compatibility with various Ruby versions, making it a versatile asset in any development toolkit.

Features

  • Performance: AccessGranted is remarkably efficient, boasting an average processing speed that is 20 times faster than its predecessors, coupled with reduced memory usage.

  • Role Management: Simplifies the definition of user roles, allowing developers to maintain clear and concise policy files without excessive conditional logic.

  • Whitelist Control: By defining permitted actions for each user role, it ensures clean and straightforward policies, reducing complexity in permission management.

  • Framework Agnostic: While it offers robust support for Rails, AccessGranted can work seamlessly with any Ruby object, giving developers flexibility in their projects.

  • Lightweight Design: At just around 300 lines of code, the gem is simple yet powerful, ensuring easy integration and maintenance in any application.

  • Zero Runtime Dependencies: With no external dependencies, it guarantees compatibility with all supported MRI Ruby versions, making it reliable for continuous use.

  • Dynamic Role Definitions: Roles can be defined using blocks or custom classes, allowing for clear organization and maintenance of role hierarchies based on application needs.

  • Hash and Block Conditions: Unique matching capabilities using hashes and blocks enable dynamic checks, ensuring precise control over permission settings based on user attributes.

rails
Ruby on Rails

Ruby on Rails, often referred to as Rails, is an open-source web application framework written in Ruby. Known for its convention over configuration and don't repeat yourself (DRY) principles, Rails simplifies and accelerates the development of database-backed web applications.