No commit activity in last 3 years
No release in over 3 years
Role based authentication
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Spine::Permissions

Gem Version Dependency Status Test Coverage Code Climate security Inline docs Codeship Status for rspine/permissions

Installation

To install it, add the gem to your Gemfile:

gem 'spine-permissions'

Then run bundle. If you're not using Bundler, just gem install spine-permissions.

Usage

Global permissions

permissions = Spine::Permissions::Collection.new
permissions.grant(:all, :all)
  .deny(:all, :projects)
  .deny(:write, :tasks)

permissions.granted?(:read, :projects)
# => false
permissions.denied?(:write, :tasks)
# => true

Role based permissions

roles = Spine::Permissions::Roles.new
roles.define(:user)
  .grant(:all, :all)
  .deny(:all, :projects)
  .deny(:write, :tasks)

roles.define(:admin)
  .grant(:all, :all)

roles.granted?(:user, :read, :tasks)
# => true
roles.denied?(:admin, :write, :tasks)
# => false