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.
- Create a new branch (git checkout -b feature-name)
- Commit your changes (git commit -m 'Add feature')
- Push to GitHub (git push origin feature-name)
- 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.