lib/authorizable/proxy.rb
def has_role_with(object)
      if object.respond_to?(:user_id)
        if object.user_id == actor.id
          return IS_OWNER
        else
          return IS_UNRELATED
        end
      end
      # hopefully the object passed always responds to user_id
      IS_UNRELATED
    end
# This method can also be overridden if one desires to have multiple types of
# ownership, such as a collaborator-type relationship
#
# @param [ActiveRecord::Base] object should be the object that is being tested
#   if the user can perform the action on
# @return [Number] true if self owns object
This method can also be overridden if one desires to have multiple types of
ownership, such as a collaborator-type relationship
This method can also be overridden if one desires to have multiple types of ownership such as a collaborator - type relationship
def has_role_with(object)
      if object.respond_to?(:user_id)
        if object.user_id == actor.id
          return IS_OWNER
        else
          return IS_UNRELATED
        end
      end
      IS_UNRELATED
    end
def has_role_with ( object ) if object . respond_to? ( :user_id ) if object . user_id == actor . id return IS_OWNER else return IS_UNRELATED end end IS_UNRELATED end
This method can also be overridden if one desires to have multiple types of
ownership, such as a collaborator-type relationship
This method can also be overridden if one desires to have multiple types of ownership such as a collaborator - type relationship
# hopefully the object passed always responds to user_id
true if self owns object
true if self owns object
Number
object
object should be the object that is being tested if the user can perform the action on
object should be the object that is being tested if the user can perform the action on