New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mintdigital-has_roles

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mintdigital-has_roles

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Install

$ gem source -a http://gems.github.com/
$ sudo gem install mintdigital-has_roles

# environment.rb
config.gem 'mintdigital-has_roles', :lib => 'has_roles'

Example

In an ActiveRecord class:

has_roles :admin, :moderator

Then run:

./script/generate has_roles && rake db:migrate

Now your model has these instance methods:

add_role(:moderator)    #=> true
remove_role(:admin)     #=> true (doesn't have role)
has_role?(:admin)       #=> false
can_have_role?(:writer) #=> false

# These are auto-generated based on your defined roles.
# They just call has_role?(name)
admin?      #=> false
moderator?  #=> true

Copyright (c) 2008 Krzysztof Zylawy, released under the MIT license

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc