lib/cloud_controller/rest_controller/model_controller.rb
# Find an object and validate that the current user has rights to
# perform the given operation on that instance.
#
# Raises an exception if the object can't be found or if the current user
# doesn't have access to it.
#
# @param [Symbol] op The type of operation to check for access
#
# @param [String] guid The GUID of the object to find.
#
# @return [Sequel::Model] The sequel model for the object, only if
# the use has access.
Find an object and validate that the current user has rights to
perform the given operation on that instance.

Raises an exception if the object can't be found or if the current user
doesn't have access to it.
Find an object and validate that the current user has rights to perform the given operation on that instance . Raises an exception if the object can ' t be found or if the current user doesn ' t have access to it .
def find_guid_and_validate_access(op, guid, find_model = model)
      obj = find_model.find(guid: guid)
      raise self.class.not_found_exception.new(guid) if obj.nil?
      validate_access(op, obj, user, roles)
      obj
    end
def find_guid_and_validate_access ( op , guid , find_model = model ) obj = find_model . find ( guid : guid ) raise self . class . not_found_exception . new ( guid ) if obj . nil? validate_access ( op , obj , user , roles ) obj end
Find an object and validate that the current user has rights to
perform the given operation on that instance.
Find an object and validate that the current user has rights to perform the given operation on that instance .
The sequel model for the object, only if the use has access.
The sequel model for the object only if the use has access .
Sequel::Model
op
<not_specific>
guid
<not_specific>
find_model
<not_specific>
model
<not_specific>
<not_specific>
guid The GUID of the object to find.
guid The GUID of the object to find .