Module: RestfulAcl::Controller::ClassMethods

Defined in:
lib/restful_acl/controller.rb

Instance Method Summary collapse

Instance Method Details

#has_permission?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
20
21
# File 'lib/restful_acl/controller.rb', line 11

def has_permission?
  options = {
    :controller_name => self.controller_name,
    :object_id       => params[:id],
    :uri             => request.fullpath,
    :user            => current_user,
    :action          => params[:action]
  }

  permission_denied unless RestfulAcl::Base.new(options).allowed?
end