Skip to content

Commit ebba21a

Browse files
Merge pull request #2707 from Dorthu/feature/rework-grants
Document changes to UserGrant structure
2 parents 35ecc77 + 425856c commit ebba21a

File tree

2 files changed

+140
-55
lines changed

2 files changed

+140
-55
lines changed

docs/src/data/endpoints/account.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,13 @@ endpoints:
348348
-X PUT -d '{
349349
"global": {
350350
"add_linodes": true
351-
}
351+
},
352+
"linodes": {[
353+
{
354+
"id": 123,
355+
"permissions": "read_only"
356+
}
357+
]}
352358
}' \
353359
https://$api_root/$version/account/users/testguy/grants
354360
python: |

docs/src/data/objects/usergrants.yaml

Lines changed: 133 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -29,96 +29,175 @@ schema:
2929
type: Boolean
3030
value: true
3131
description: If this user may manage longview subscription.
32-
customer:
33-
type: Object
34-
description: Grants related to modifying the account.
35-
access:
32+
add_images:
3633
type: Boolean
37-
value: false
38-
description: If this user may modify the account.
39-
cancel:
34+
value: true
35+
description: If this user may create images.
36+
add_volumes:
37+
type: Boolean
38+
value: true
39+
description: If this user may create volumes.
40+
account_access:
41+
type: Enum
42+
subtype: GrantLevel
43+
value: read_write
44+
description: >
45+
The level of access this user has to account information. read_only gives
46+
access to view billing and payment history, read_write gives access to
47+
make payments, and null is no access.
48+
cancel_account:
4049
type: Boolean
4150
value: false
42-
description: If this user may cancel the account.
51+
description: If this user may cancel the entire account.
4352
stackscript:
4453
type: Object
4554
isArray: true
46-
description: Individual grants to StackScripts you own. Grants include all, use, edit and delete
47-
all:
48-
type: Boolean
49-
value: false
50-
edit:
51-
type: Boolean
52-
value: true
53-
delete:
54-
type: Boolean
55-
value: false
55+
description: Individual grants this user has to StackScripts you own.
5656
id:
5757
type: Boolean
58-
value: 123
58+
value: 456
5959
label:
6060
type: string
6161
value: Wordpress
62-
use:
63-
type: Boolean
64-
value: false
62+
permissions:
63+
type: Enum
64+
subtype: GrantLevel
65+
value: read_only
66+
description: >
67+
The level of access this user has to this StackScript. null
68+
is no access, read_only allows viewing and deploying from the stackscript,
69+
and read_write allows making revisions.
6570
nodebalancer:
6671
type: object
6772
isArray: true
68-
description: Individual grants to NodeBalancers you own. Grants inlcude all, access, and delete
69-
all:
70-
type: Boolean
71-
value: false
72-
access:
73-
type: Boolean
74-
value: true
75-
delete:
76-
type: Boolean
77-
value: false
73+
description: Individual grants this user has to NodeBalancers you own.
7874
id:
7975
type: Integer
80-
value: 123
76+
value: 567
8177
label:
8278
type: String
8379
value: linode123
80+
permissions:
81+
type: Enum
82+
subtype: GrantLevel
83+
value: read_only
84+
description: >
85+
The level of access this user has to this NodeBalancer. null is no access,
86+
read_only allows viewing it and its configs and nodes, and read_write
87+
allows changing the NodeBalancer and its configs and nodes, including
88+
adding/removing configs and nodes.
8489
linode:
8590
type: object
8691
isArray: true
87-
description: Individual grants to a Linode you own. Grants include all, access, resize, and delete
88-
all:
89-
type: Boolean
90-
value: false
91-
access:
92-
type: Boolean
93-
value: true
94-
resize:
95-
type: Boolean
96-
value: true
97-
delete:
98-
type: Boolean
99-
value: false
92+
description: Individual grants this user has to a Linode you own.
10093
id:
10194
type: Integer
10295
value: 123
96+
description: The ID of the Linode this grant applies to.
10397
label:
10498
type: String
10599
value: linode123
100+
description: The label of the Linode this grant applies to.
101+
permissions:
102+
type: Enum
103+
subtype: GrantLevel
104+
value: read_write
105+
description: >
106+
The level of access this user has to this Linode. null is no access,
107+
read_only gives the ability to view this Linode and its disks, and
108+
read_write allows complete control over this Linode, including its
109+
configs, disks, attached volumes, and power state.
106110
domain:
107111
type: object
108112
isArray: true
109-
description: Individual grants to a Domain you own. Grants include all, access and delete
110-
all:
113+
description: Individual grants a user has to a Domain you own.
114+
id:
111115
type: Boolean
112-
value: false
113-
access:
116+
value: 432
117+
description: The ID of the domain this grant applies to.
118+
label:
114119
type: Boolean
115-
value: true
116-
delete:
120+
value: example.com
121+
description: The domain name this grant applies to.
122+
permissions:
123+
type: Enum
124+
subtype: GrantLevel
125+
value: read_write
126+
description: >
127+
The level of access this user has to this Domain. null is no access,
128+
read_only gives access to view this domain and its records, and read_write
129+
gives complete control over the domain, including adding and removing
130+
records.
131+
volume:
132+
type: object
133+
isArray: true
134+
description: Individual grants a user has to a Volume you own.
135+
id:
117136
type: Boolean
118-
value: false
137+
value: 987
138+
description: The ID of the volume this grant applies to.
139+
label:
140+
type: Boolean
141+
value: example.com
142+
description: The label of the volume this grant applies to.
143+
permissions:
144+
type: Enum
145+
subtype: GrantLevel
146+
value: null
147+
description: >
148+
The level of access this user has to this Volume. null is no access,
149+
read_only gives access to view this volume, and read_write
150+
gives full control over the volume, including allow it to be attached
151+
and detached.
152+
image:
153+
type: object
154+
isArray: true
155+
description: Individual grants a user has to a Image you own.
119156
id:
120157
type: Boolean
121-
value: 123
158+
value: 903
159+
description: The ID of the image this grant applies to.
160+
label:
161+
type: Boolean
162+
value: example.com
163+
description: The label of the image this grant applies to.
164+
permissions:
165+
type: Enum
166+
subtype: GrantLevel
167+
value: read_write
168+
description: >
169+
The level of access this user has to this Image. null is no access,
170+
read_only gives access to view this image, and read_write allows full
171+
control over this image, including deploying linodes from it and
172+
removing it from the account.
173+
longview:
174+
type: object
175+
isArray: true
176+
description: Individual grants a user has to a Longview Client you own.
177+
id:
178+
type: Boolean
179+
value: 231
180+
description: The ID of the longview client this grant applies to.
122181
label:
123182
type: Boolean
124183
value: example.com
184+
description: The label of the longview client this grant applies to.
185+
permissions:
186+
type: Enum
187+
subtype: GrantLevel
188+
value: read_write
189+
description: >
190+
The level of access this user has to this Longview Client. null is no access,
191+
read_only gives access to view this client, including viewing its api key
192+
that can be used to retrieve the stats it is tracking, and read_write
193+
grants full access to the client, including the ability to remove it from
194+
the account.
195+
enums:
196+
GrantLevel:
197+
null: no access
198+
read_only: >
199+
access to GET endpoints related to this entity and its subobjects, events
200+
related to it, and this entities appearance in listing endpoints.
201+
read_write: >
202+
access to all endpoints related to this entity, including POST, PUT, and
203+
DELETE endpoints for this entity and its subobjects

0 commit comments

Comments
 (0)