How would you store roles with up to 64 permissions?

This page summarizes the projects mentioned and recommended in the original post on /r/rails

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • CanCanCan

    The authorization Gem for Ruby on Rails.

  • Would you do : 1. a roles table with the name of the role and 64 booleans? 2. A roles table with one JSON field? (using rails json data type) 3. A roles table and a permissions table, similar do what is suggested in the cancancan developpers guide:

  • activerecord-typedstore

    ActiveRecord::Store but with type definition

  • I guess it depends on how frequently the roles or flags change, but we use https://github.com/byroot/activerecord-typedstore and a jsonb field. We add flags as needed and cache them, but also things like role limits, without the need for db migrations or a hefty load of columns.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts