module Omniperm::Helpers

Private Instance Methods

hierarchy() click to toggle source
# File lib/omniperm/helpers.rb, line 6
def hierarchy
  if [Class, Module].include?(self.class)
    name
  else
    self.class.to_s
  end
end
service_authorized!(obj = nil) click to toggle source
# File lib/omniperm/helpers.rb, line 19
def service_authorized!(obj = nil)
  strategy = __omniperm_determine_strategy(obj)
  Core.authorize_service(obj, returnable: "raise", hierarchy: hierarchy, strategy: strategy)
end
service_authorized?(obj = nil) click to toggle source
# File lib/omniperm/helpers.rb, line 14
def service_authorized?(obj = nil)
  strategy = __omniperm_determine_strategy(obj)
  Core.authorize_service(obj, returnable: "boolean", hierarchy: hierarchy, strategy: strategy)
end