Module: HasRoles::InstanceMethods
- Defined in:
- lib/has_roles.rb
Instance Method Summary (collapse)
-
- (Boolean) authorized_for?(options = '')
Checks whether this user is authorized to access the given url.
Instance Method Details
- (Boolean) authorized_for?(options = '')
Checks whether this user is authorized to access the given url.
Examples
user = User.find(1)
user.(:controller => 'admin/messages')
user.(:controller => 'admin/messages', :action => 'destroy')
user.('admin/messages')
user.('http://localhost:3000/admin/messages')
30 31 32 |
# File 'lib/has_roles.rb', line 30 def ( = '') !Permission.restricts?() || roles.().exists? end |