lib/cloud_controller/rest_controller/model_controller.rb
# Validate that the current logged in user can have access to the target object.
#
# Raises an exception if the user does not have rights to perform
# the operation on the object.
#
# @param [Symbol] op The type of operation to check for access
#
# @param [Object] obj The object for which to validate access.
#
# @param [User] user The user for which to validate access.
#
# @param [Roles] The roles for the current user or client.
Validate that the current logged in user can have access to the target object.
Raises an exception if the user does not have rights to perform
the operation on the object.
Validate that the current logged in user can have access to the target object . Raises an exception if the user does not have rights to perform the operation on the object .
def validate_access(op, obj, user, roles)
      if cannot? op, obj
        raise NotAuthenticated if user.nil? && roles.none?
        logger.info("allowy.access-denied", op: op, obj: obj, user: user, roles: roles)
        raise Errors::NotAuthorized
      end
    end
def validate_access ( op , obj , user , roles ) if cannot? op , obj raise NotAuthenticated if user . nil? && roles . none? logger . info ( "allowy.access-denied" , op : op , obj : obj , user : user , roles : roles ) raise Errors :: NotAuthorized end end
Validate that the current logged in user can have access to the target object.
Validate that the current logged in user can have access to the target object .
op
<not_specific>
obj
<not_specific>
user
<not_specific>
roles
<not_specific>
<not_specific>
The roles for the current user or client.
The roles for the current user or client .