Skip to content

Commit

Permalink
Added a new role space editor without versions
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Aug 21, 2024
1 parent 774910f commit 681ff2a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/new-role-editor-wo-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Added a new role space editor without versions

We add a new role space editor without list and restore version permissions.


https://github.com/cs3org/reva/pull/4817
https://github.com/owncloud/ocis/issues/9699
24 changes: 24 additions & 0 deletions pkg/conversions/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const (
RoleEditor = "editor"
// RoleSpaceEditor grants editor permission on a space.
RoleSpaceEditor = "spaceeditor"
// RoleSpaceEditorWithoutVersions grants editor permission without list/restore versions on a space.
RoleSpaceEditorWithoutVersions = "spaceeditor-without-versions"
// RoleFileEditor grants editor permission on a single file.
RoleFileEditor = "file-editor"
// RoleCoowner grants co-owner permissions on a resource.
Expand Down Expand Up @@ -272,6 +274,28 @@ func NewSpaceEditorRole() *Role {
}
}

// NewSpaceEditorWithoutVersionsRole creates an editor without list/restore versions role
func NewSpaceEditorWithoutVersionsRole() *Role {
return &Role{
Name: RoleSpaceEditorWithoutVersions,
cS3ResourcePermissions: &provider.ResourcePermissions{
CreateContainer: true,
Delete: true,
GetPath: true,
GetQuota: true,
InitiateFileDownload: true,
InitiateFileUpload: true,
ListContainer: true,
ListGrants: true,
ListRecycle: true,
Move: true,
RestoreRecycleItem: true,
Stat: true,
},
ocsPermissions: PermissionRead | PermissionCreate | PermissionWrite | PermissionDelete,
}
}

// NewFileEditorRole creates a file-editor role
func NewFileEditorRole() *Role {
p := PermissionRead | PermissionWrite
Expand Down

0 comments on commit 681ff2a

Please sign in to comment.