module Strongbolt::Helpers

Public Instance Methods

can?(*args) { || ... } click to toggle source
# File lib/strongbolt/helpers.rb, line 3
def can?(*args, &block)
  # Block can be used when testing an instance
  Strongbolt.without_authorization do
    args.insert 1, yield if block.present?

    return current_user.can?(*args)
  end
end
cannot?(*args, &block) click to toggle source
# File lib/strongbolt/helpers.rb, line 12
def cannot?(*args, &block)
  !can?(*args, &block)
end