0.0
The project is in a healthy, maintained state
Automatically adds role-checking methods based on dynamic roles.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

RoleChecker

A Ruby gem for dynamic role checking.

Installation

gem install role_checker

Usage

class User include RoleChecker

define_roles(%w[admin user editor]) #It need to add bottom of the class and change the role according to your project. end

user = User.new("admin") puts user.admin? # true puts user.user? # false

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/shubham-chauhan-dev/role_checker. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

  1. Create a new branch (git checkout -b feature-name)
  2. Commit your changes (git commit -m 'Add feature')
  3. Push to GitHub (git push origin feature-name)
  4. Open a pull request

Code of Conduct

Everyone interacting in the RoleChecker project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.