@@ -45,6 +45,8 @@ const (
45
45
RoleEditor = "editor"
46
46
// RoleEditorListGrants grants editor permission on a resource, including folders.
47
47
RoleEditorListGrants = "editor-list-grants"
48
+ // RoleEditorListGrantsWithVersions grants editor permission on a resource, including folders.
49
+ RoleEditorListGrantsWithVersions = "editor-list-grants-with-versions"
48
50
// RoleSpaceEditor grants editor permission on a space.
49
51
RoleSpaceEditor = "spaceeditor"
50
52
// RoleSpaceEditorWithoutVersions grants editor permission without list/restore versions on a space.
@@ -53,6 +55,8 @@ const (
53
55
RoleFileEditor = "file-editor"
54
56
// RoleFileEditorListGrants grants editor permission on a single file.
55
57
RoleFileEditorListGrants = "file-editor-list-grants"
58
+ // RoleFileEditorListGrantsWithVersions grants editor permission on a single file.
59
+ RoleFileEditorListGrantsWithVersions = "file-editor-list-grants-with-versions"
56
60
// RoleCoowner grants co-owner permissions on a resource.
57
61
RoleCoowner = "coowner"
58
62
// RoleEditorLite grants permission to upload and download to a resource.
@@ -171,12 +175,16 @@ func RoleFromName(name string) *Role {
171
175
return NewEditorRole ()
172
176
case RoleEditorListGrants :
173
177
return NewEditorListGrantsRole ()
178
+ case RoleEditorListGrantsWithVersions :
179
+ return NewEditorListGrantsWithVersionsRole ()
174
180
case RoleSpaceEditor :
175
181
return NewSpaceEditorRole ()
176
182
case RoleFileEditor :
177
183
return NewFileEditorRole ()
178
184
case RoleFileEditorListGrants :
179
185
return NewFileEditorListGrantsRole ()
186
+ case RoleFileEditorListGrantsWithVersions :
187
+ return NewFileEditorListGrantsWithVersionsRole ()
180
188
case RoleUploader :
181
189
return NewUploaderRole ()
182
190
case RoleManager :
@@ -276,6 +284,14 @@ func NewEditorListGrantsRole() *Role {
276
284
return role
277
285
}
278
286
287
+ // NewEditorListGrantsWithVersionsRole creates an editor role. `sharing` indicates if sharing permission should be added
288
+ func NewEditorListGrantsWithVersionsRole () * Role {
289
+ role := NewEditorListGrantsRole ()
290
+ role .cS3ResourcePermissions .ListFileVersions = true
291
+ role .cS3ResourcePermissions .RestoreFileVersion = true
292
+ return role
293
+ }
294
+
279
295
// NewSpaceEditorRole creates an editor role
280
296
func NewSpaceEditorRole () * Role {
281
297
return & Role {
@@ -348,6 +364,14 @@ func NewFileEditorListGrantsRole() *Role {
348
364
return role
349
365
}
350
366
367
+ // NewFileEditorListGrantsWithVersionsRole creates a file-editor role
368
+ func NewFileEditorListGrantsWithVersionsRole () * Role {
369
+ role := NewFileEditorListGrantsRole ()
370
+ role .cS3ResourcePermissions .ListFileVersions = true
371
+ role .cS3ResourcePermissions .RestoreFileVersion = true
372
+ return role
373
+ }
374
+
351
375
// NewCoownerRole creates a coowner role.
352
376
func NewCoownerRole () * Role {
353
377
return & Role {
0 commit comments