lib/declarative_authorization/in_controller.rb
# Works similar to the permitted_to? method, but doesn't accept a block
# and throws the authorization exceptions, just like Engine#permit!
Works similar to the permitted_to. method, but doesn't accept a block
and throws the authorization exceptions, just like Engine#permit!
Works similar to the permitted_to . method but doesn ' t accept a block and throws the authorization exceptions just like Engine#permit!
def permitted_to! (privilege, object_or_sym = nil)
      context = object = nil
      if object_or_sym.is_a?(Symbol)
        context = object_or_sym
      else
        object = object_or_sym
      end
      authorization_engine.permit!(privilege, 
          {:user => current_user, 
           :object => object,
           :context => context,
           :skip_attribute_test => object.nil?})
    end
def permitted_to! ( privilege , object_or_sym = nil ) context = object = nil if object_or_sym . is_a? ( Symbol ) context = object_or_sym else object = object_or_sym end authorization_engine . permit! ( privilege , { :user => current_user , :object => object , :context => context , :skip_attribute_test => object . nil? } ) end
Works similar to the permitted_to?
Works similar to the permitted_to?
privilege
<not_specific>
object_or_sym
<not_specific>