Project

roleup

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

Development

 Project Readme

Lines of Code Code Status Dependency Status Build Status Coverage Status Downloads

Roleup

Incredibly simple role management. Leaves authorization up to you.

Checkout Perm for a simple authorization solution.

Quickstart

gem install roleup
class User
  include Roleup::HasRoles
end

user = User.new
user.roles = [:reader, :writer]

user.has_role? :reader # => true
user.has_all_roles? :reader, :writer # => true
user.has_all_roles? :reader, :writer, :editor # => false
user.has_one_role? :writer, :editor, :admin # => true

user.roles << :admin
user.has_role? :admin # => true

user.roles.delete :admin
user.has_role? :admin # => false