From a1ac71b146eafdccf76cedb243b60107771e5de9 Mon Sep 17 00:00:00 2001 From: Julian Koberg Date: Wed, 5 Mar 2025 14:16:27 +0100 Subject: [PATCH] fix(ocis): fix role translations Signed-off-by: Julian Koberg --- changelog/unreleased/Fix-Role-Names.md | 5 +++++ services/graph/pkg/unifiedrole/roles.go | 22 +++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 changelog/unreleased/Fix-Role-Names.md diff --git a/changelog/unreleased/Fix-Role-Names.md b/changelog/unreleased/Fix-Role-Names.md new file mode 100644 index 00000000000..6a63cab3479 --- /dev/null +++ b/changelog/unreleased/Fix-Role-Names.md @@ -0,0 +1,5 @@ +Bugfix: Fix translations of editor roles + +Uses the correct translations strings for ocis roles + +https://github.com/owncloud/ocis/pull/11098 diff --git a/services/graph/pkg/unifiedrole/roles.go b/services/graph/pkg/unifiedrole/roles.go index 050cabd9bb6..d703fa5162c 100644 --- a/services/graph/pkg/unifiedrole/roles.go +++ b/services/graph/pkg/unifiedrole/roles.go @@ -104,7 +104,7 @@ var ( // UnifiedRole ViewerListGrants, Role Description (resolves directly) _viewerListGrantsUnifiedRoleDescription = l10n.Template("View, download and show all invited people.") - // UnifiedRole Viewer, Role DisplayName (resolves directly) + // UnifiedRole ViewerListGrants, Role DisplayName (resolves directly) _viewerListGrantsUnifiedRoleDisplayName = l10n.Template("Can view") // UnifiedRole SpaceViewer, Role Description (resolves directly) @@ -117,18 +117,18 @@ var ( _editorUnifiedRoleDescription = l10n.Template("View, download, upload, edit, add and delete.") // UnifiedRole Editor, Role DisplayName (resolves directly) - _editorUnifiedRoleDisplayName = l10n.Template("Can edit") + _editorUnifiedRoleDisplayName = l10n.Template("Can edit without versions") - // UnifiedRoleListGrants Editor, Role Description (resolves directly) + // UnifiedRole EditorListGrants Editor, Role Description (resolves directly) _editorListGrantsUnifiedRoleDescription = l10n.Template("View, download, upload, edit, add, delete and show all invited people.") // UnifiedRole EditorListGrants, Role DisplayName (resolves directly) - _editorListGrantsUnifiedRoleDisplayName = l10n.Template("Can edit") + _editorListGrantsUnifiedRoleDisplayName = l10n.Template("Can edit without versions") - // UnifiedRoleListGrants Editor, Role Description (resolves directly) + // UnifiedRole EditorListGrantsWithVersions, Role Description (resolves directly) _editorListGrantsWithVersionsUnifiedRoleDescription = l10n.Template("View, download, upload, edit, delete and show all invited people, show all versions.") - // UnifiedRole EditorListGrants, Role DisplayName (resolves directly) + // UnifiedRole EditorListGrantsWithVersions, Role DisplayName (resolves directly) _editorListGrantsWithVersionsUnifiedRoleDisplayName = l10n.Template("Can edit") // UnifiedRole SpaseEditor, Role Description (resolves directly) @@ -147,13 +147,13 @@ var ( _fileEditorUnifiedRoleDescription = l10n.Template("View, download and edit.") // UnifiedRole FileEditor, Role DisplayName (resolves directly) - _fileEditorUnifiedRoleDisplayName = l10n.Template("Can edit") + _fileEditorUnifiedRoleDisplayName = l10n.Template("Can edit without versions") // UnifiedRole FileEditorListGrants, Role Description (resolves directly) _fileEditorListGrantsUnifiedRoleDescription = l10n.Template("View, download, edit and show all invited people.") // UnifiedRole FileEditorListGrants, Role DisplayName (resolves directly) - _fileEditorListGrantsUnifiedRoleDisplayName = l10n.Template("Can edit") + _fileEditorListGrantsUnifiedRoleDisplayName = l10n.Template("Can edit without versions") // UnifiedRole FileEditorListGrants, Role Description (resolves directly) _fileEditorListGrantsWithVersionsUnifiedRoleDescription = l10n.Template("View, download, edit and show all invited people, show all versions.") @@ -336,9 +336,11 @@ var ( } }() - // roleEditorListGrantsWithVersions creates an editor role. + // roleEditorListGrantsWithVersions creates an editor-list-grants-with-versions role. roleEditorListGrantsWithVersions = func() *libregraph.UnifiedRoleDefinition { r := conversions.NewEditorListGrantsWithVersionsRole() + // TODO: Workaround to avoid reva bump - fix in reva + r.Name = conversions.RoleEditorListGrantsWithVersions return &libregraph.UnifiedRoleDefinition{ Id: proto.String(UnifiedRoleEditorListGrantsWithVersionsID), Description: proto.String(_editorListGrantsWithVersionsUnifiedRoleDescription), @@ -436,6 +438,8 @@ var ( // roleFileEditorListGrantsWithVersions creates a file-editor role roleFileEditorListGrantsWithVersions = func() *libregraph.UnifiedRoleDefinition { r := conversions.NewFileEditorListGrantsWithVersionsRole() + // TODO: Workaround to avoid reva bump - fix in reva + r.Name = conversions.RoleFileEditorListGrantsWithVersions return &libregraph.UnifiedRoleDefinition{ Id: proto.String(UnifiedRoleFileEditorListGrantsWithVersionsID), Description: proto.String(_fileEditorListGrantsWithVersionsUnifiedRoleDescription),