module Aclize::Helper
Public Instance Methods
aclized?()
click to toggle source
# File lib/aclize/helper.rb, line 4 def aclized? true end
action_allowed?(controller, action)
click to toggle source
Check if the user have permission to access the action
# File lib/aclize/helper.rb, line 9 def action_allowed?(controller, action) actions_allowed?(controller, [action]) end
actions_allowed?(controller, actions = [])
click to toggle source
Returns a boolean that indicates if the current user have enought permissions to access the specified list of actions.
# File lib/aclize/helper.rb, line 16 def actions_allowed?(controller, actions = []) acl = @_aclize_acl.get_acl_for(get_current_role) return acl.controllers.permitted?(controller, actions) end
get_current_role()
click to toggle source
# File lib/aclize/helper.rb, line 30 def get_current_role return @_aclize_current_role || :all end
path_allowed?(path)
click to toggle source
Verify if the path could be accessed by the user. Returns true when the path is accessible
# File lib/aclize/helper.rb, line 24 def path_allowed?(path) acl = @_aclize_acl.get_acl_for(get_current_role) return acl.paths.permitted?(path) end