-
Notifications
You must be signed in to change notification settings - Fork 284
/
show.json.rabl
70 lines (61 loc) · 1.51 KB
/
show.json.rabl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
object @resource
extends 'katello/api/v2/common/identifier'
extends 'katello/api/v2/common/org_reference'
extends 'katello/api/v2/common/timestamps'
attributes :name
attributes :content_type
attributes :content
child :products => :products do
attributes :id, :cp_id, :name
node :repository_count do |product|
product.repositories.count
end
child :provider => :provider do
attribute :name
attribute :id
end
end
child :repositories => :repositories do
attribute :id
attribute :name
child :product do |_product|
attributes :id, :cp_id, :name
end
end
child :ssl_ca_products => :ssl_ca_products do
attributes :id, :cp_id, :name
node :repository_count do |product|
product.repositories.count
end
child :provider => :provider do
attribute :name
attribute :id
end
end
child :ssl_client_products => :ssl_client_products do
attributes :id, :cp_id, :name
node :repository_count do |product|
product.repositories.count
end
child :provider => :provider do
attribute :name
attribute :id
end
end
child :ssl_key_products => :ssl_key_products do
attributes :id, :cp_id, :name
node :repository_count do |product|
product.repositories.count
end
child :provider => :provider do
attribute :name
attribute :id
end
end
node :permissions do |content_credential|
{
:view_content_credenials => content_credential.readable?,
:edit_content_credenials => content_credential.editable?,
:destroy_content_credenials => content_credential.deletable?
}
end