Pundit
Minimal authorization through OO design and pure Ruby classes (by varvet)
Action Policy
Authorization framework for Ruby/Rails applications (by palkan)
Our great sponsors
Pundit | Action Policy | |
---|---|---|
20 | 5 | |
7,850 | 1,066 | |
0.5% | - | |
3.4 | 5.8 | |
19 days ago | 8 days ago | |
Ruby | Ruby | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Pundit
Posts with mentions or reviews of Pundit.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-11-30.
-
Permissions (access control) in web apps
https://github.com/varvet/pundit Popular open-source Ruby library focused around the notion of policies, giving you the freedom to implement your own approach based on that.
-
YAGNI exceptions
PS If you do mobile / web work (or something else with "detached" UI), I find that declarative access control rules are far superior to imperative ones, because they can be serialized and shipped over the wire. For example, backend running cancancan can be easily send the same rules to casl on the frontend, while if you used something like pundit to secure your backend, you either end up re-implementing it in the frontend, or sending ton of "canEdit" flags with every record.
-
Best practice for displaying info to different user roles?
You can use a combination of an authorization gem (https://github.com/varvet/pundit) and decorators (https://www.rubyguides.com/2018/04/decorator-pattern-in-ruby/) if you want to extend functionality based on their roles.
-
Concerns about authorization when going in production
Use Action Policy or Pundit, and write tests for your policies. Authz is worth testing with near complete coverage.
-
Complete Guide To Managing User Permissions In Rails Apps
Pundit: Pundit is a gem that uses simple Ruby objects, and it is probably the simplest policy gem we will cover. Is simple to use, has minimal authorization, and is similar to using pure Ruby. With 7.3k stars on GitHub, it is currently the most popular policy gem.
-
Authorization and Policy Scopes for Phoenix Apps
If you come from the Rails world, you might be familiar with some gems that provide APIs to handle this, the most popular ones being cancancan and pundit.
-
Conditional Rendering With Turbo Stream Broadcasts
A very common pattern in Rails development is for a view to contain checks for things like current_user.can?(:take_some_action). These types of checks are common, especially in B2B applications that implement role-based permissions powered by a solution like Pundit.
-
Rails application boilerplate for fast MVP development
authorization with pundit
-
Frontend based access control?
Right now, all access control is done using Pundit and since most things are server side rendered, not only are the API endpoints authorized by Pundit policies, but some UI components conditionally render based on these policies as well.
-
Access control gem for your Rails application (the 2nd)
You may ask what's makes Active Entry better or different from other gems like Pundit, Action Policy (especially), or CanCanCan.
Action Policy
Posts with mentions or reviews of Action Policy.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-08-16.
-
Concerns about authorization when going in production
Use Action Policy or Pundit, and write tests for your policies. Authz is worth testing with near complete coverage.
-
Access control gem for your Rails application (the 2nd)
You may ask what's makes Active Entry better or different from other gems like Pundit, Action Policy (especially), or CanCanCan.
What are some alternatives?
When comparing Pundit and Action Policy you can also consider the following projects:
CanCanCan - The authorization Gem for Ruby on Rails.
rolify - Role management library with resource scoping
Devise - Flexible authentication solution for Rails with Warden.
Authority
Declarative Authorization - An unmaintained authorization plugin for Rails. Please fork to support current versions of Rails
Consul - Scope-based authorization for Ruby on Rails.
AccessGranted - Multi-role and whitelist based authorization gem for Rails (and not only Rails!)
oso - Oso is a batteries-included framework for building authorization in your application.
acl9 - Yet another role-based authorization system for Rails
banken - Simple and lightweight authorization library for Rails