app/lib/katello/resources/candlepin/owner.rb in katello-4.5.1 vs app/lib/katello/resources/candlepin/owner.rb in katello-4.6.0.rc1
- old
+ new
@@ -10,12 +10,18 @@
JSON.parse(response.body)
end
# Set the contentPrefix at creation time so that the client will get
# content only for the org it has been subscribed to
- def create(key, description)
- attrs = {:key => key, :displayName => description, :contentPrefix => "/#{key}/$env"}
+ def create(key, description, content_access_mode: 'org_environment')
+ attrs = {
+ :key => key,
+ :displayName => description,
+ :contentPrefix => "/#{key}/$env",
+ :contentAccessMode => content_access_mode,
+ :contentAccessModeList => ['entitlement', 'org_environment'].join(',')
+ }
owner_json = self.post(path, attrs.to_json, self.default_headers).body
JSON.parse(owner_json).with_indifferent_access
end
# create the first user for owner
@@ -34,9 +40,10 @@
end
def update(key, attrs)
owner = find(key)
owner.merge!(attrs)
+ owner.merge!(:contentAccessModeList => ['entitlement', 'org_environment'].join(','))
self.put(path(key), JSON.generate(owner), self.default_headers).body
end
def import(organization_name, path_to_file, options)
path = join_path(path(organization_name), 'imports/async')