Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions services/graph/pkg/unifiedrole/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ func cs3RoleToDisplayName(role *conversions.Role) string {
return _fileEditorUnifiedRoleDisplayName
case conversions.RoleFileEditorListGrants:
return _fileEditorListGrantsUnifiedRoleDisplayName
case conversions.RoleEditorLitePlus:
return _editorLitePlusUnifiedRoleDisplayName
case conversions.RoleEditorLite:
return _editorLiteUnifiedRoleDisplayName
case conversions.RoleManager:
Expand Down
27 changes: 27 additions & 0 deletions services/graph/pkg/unifiedrole/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const (
UnifiedRoleFileEditorID = "2d00ce52-1fc2-4dbc-8b95-a73b73395f5a"
// UnifiedRoleFileEditorListGrantsID Unified role file editor id.
UnifiedRoleFileEditorListGrantsID = "c1235aea-d106-42db-8458-7d5610fb0a67"
// UnifiedRoleEditorLitePlusID Unified role editor-lite-plus id.
UnifiedRoleEditorLitePlusID = "48d8a2b0-d7c2-4b63-a0b5-2e3f5c9e8d1a"
// UnifiedRoleEditorLiteID Unified role editor-lite id.
UnifiedRoleEditorLiteID = "1c996275-f1c9-4e71-abdf-a42f6495e960"
// UnifiedRoleManagerID Unified role manager id.
Expand Down Expand Up @@ -145,6 +147,12 @@ var (
// UnifiedRole FileEditorListGrants, Role DisplayName (resolves directly)
_fileEditorListGrantsUnifiedRoleDisplayName = l10n.Template("Can edit")

// UnifiedRole EditorLitePlus, Role Description (resolves directly)
_editorLightUnifiedRoleDescription = l10n.Template("View, download, upload, edit and add. No delete.")

// UnifiedRole EditorLitePlus, Role DisplayName (resolves directly)
_editorLightUnifiedRoleDisplayName = l10n.Template("Can edit (no delete)")

// UnifiedRole EditorLite, Role Description (resolves directly)
_editorLiteUnifiedRoleDescription = l10n.Template("View, download and upload.")

Expand Down Expand Up @@ -179,6 +187,7 @@ var (
UnifiedRoleSpaceEditorWithoutVersionsID: conversions.RoleSpaceEditorWithoutVersions,
UnifiedRoleEditorID: conversions.RoleEditor,
UnifiedRoleFileEditorID: conversions.RoleFileEditor,
UnifiedRoleEditorLitePlusID: conversions.RoleEditorLitePlus,
UnifiedRoleEditorLiteID: conversions.RoleEditorLite,
UnifiedRoleManagerID: conversions.RoleManager,
UnifiedRoleSecureViewerID: conversions.RoleSecureViewer,
Expand All @@ -195,6 +204,7 @@ var (
roleSpaceEditorWithoutVersions,
roleFileEditor,
roleFileEditorListGrants,
roleEditorLitePlus,
roleEditorLite,
roleManager,
roleSecureViewer,
Expand Down Expand Up @@ -314,6 +324,23 @@ var (
}
}()

// roleEditorLitePlus creates an editor role without delete permission.
roleEditorLitePlus = func() *libregraph.UnifiedRoleDefinition {
r := conversions.NewEditorLitePlusRole()
return &libregraph.UnifiedRoleDefinition{
Id: proto.String(UnifiedRoleEditorLitePlusID),
Description: proto.String(_editorLitePlusUnifiedRoleDescription),
DisplayName: proto.String(cs3RoleToDisplayName(r)),
RolePermissions: []libregraph.UnifiedRolePermission{
{
AllowedResourceActions: CS3ResourcePermissionsToLibregraphActions(r.CS3ResourcePermissions()),
Condition: proto.String(UnifiedRoleConditionFolder),
},
},
LibreGraphWeight: proto.Int32(55),
}
}()

// roleEditor creates an editor role.
roleEditor = func() *libregraph.UnifiedRoleDefinition {
r := conversions.NewEditorRole()
Expand Down
21 changes: 21 additions & 0 deletions vendor/github.com/opencloud-eu/reva/v2/pkg/conversions/role.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.