Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: defaults
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (32 sloc) 1.029 kB
# Copyright (c) 2009-2012 VMware, Inc.
module VCAP::CloudController
rest_controller :Space do
permissions_required do
full Permissions::CFAdmin
full Permissions::OrgManager
read Permissions::SpaceManager
update Permissions::SpaceManager
read Permissions::SpaceDeveloper
read Permissions::SpaceAuditor
end
define_attributes do
attribute :name, String
to_one :organization
to_many :developers
to_many :managers
to_many :auditors
to_many :apps
to_many :domains
to_many :service_instances
end
query_parameters :name, :organization_guid, :developer_guid, :app_guid
def self.translate_validation_exception(e, attributes)
name_errors = e.errors.on([:organization_id, :name])
if name_errors && name_errors.include?(:unique)
Errors::SpaceNameTaken.new(attributes["name"])
else
Errors::SpaceInvalid.new(e.errors.full_messages)
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.