diff --git a/services/graph/pkg/unifiedrole/unifiedrole.go b/services/graph/pkg/unifiedrole/unifiedrole.go index cd20a93ec..75037fe54 100644 --- a/services/graph/pkg/unifiedrole/unifiedrole.go +++ b/services/graph/pkg/unifiedrole/unifiedrole.go @@ -23,8 +23,8 @@ const ( UnifiedRoleSpaceEditorID = "58c63c02-1d89-4572-916a-870abc5a1b7d" // UnifiedRoleFileEditorID Unified role file editor id. UnifiedRoleFileEditorID = "2d00ce52-1fc2-4dbc-8b95-a73b73395f5a" - // UnifiedRoleUploaderID Unified role uploader id. - UnifiedRoleUploaderID = "1c996275-f1c9-4e71-abdf-a42f6495e960" + // UnifiedRoleEditorLiteID Unified role editor-lite id. + UnifiedRoleEditorLiteID = "1c996275-f1c9-4e71-abdf-a42f6495e960" // UnifiedRoleManagerID Unified role manager id. UnifiedRoleManagerID = "312c0871-5ef7-4b3a-85b6-0e4074c64049" // UnifiedRoleSecureViewerID Unified role secure viewer id. @@ -66,7 +66,7 @@ var legacyNames map[string]string = map[string]string{ UnifiedRoleSpaceEditorID: "editor", UnifiedRoleEditorID: conversions.RoleEditor, UnifiedRoleFileEditorID: conversions.RoleFileEditor, - UnifiedRoleUploaderID: conversions.RoleUploader, + UnifiedRoleEditorLiteID: conversions.RoleEditorLite, UnifiedRoleManagerID: conversions.RoleManager, UnifiedRoleSecureViewerID: conversions.RoleSecureViewer, } @@ -160,11 +160,11 @@ func NewFileEditorUnifiedRole() *libregraph.UnifiedRoleDefinition { } } -// NewUploaderUnifiedRole creates an uploader role -func NewUploaderUnifiedRole() *libregraph.UnifiedRoleDefinition { - r := conversions.NewUploaderRole() +// NewEditorLiteUnifiedRole creates an editor-lite role +func NewEditorLiteUnifiedRole() *libregraph.UnifiedRoleDefinition { + r := conversions.NewEditorLiteRole() return &libregraph.UnifiedRoleDefinition{ - Id: proto.String(UnifiedRoleUploaderID), + Id: proto.String(UnifiedRoleEditorLiteID), Description: proto.String("View, download and upload."), DisplayName: displayName(r), RolePermissions: []libregraph.UnifiedRolePermission{ @@ -239,7 +239,7 @@ func GetBuiltinRoleDefinitionList() []*libregraph.UnifiedRoleDefinition { NewEditorUnifiedRole(), NewSpaceEditorUnifiedRole(), NewFileEditorUnifiedRole(), - NewUploaderUnifiedRole(), + NewEditorLiteUnifiedRole(), NewManagerUnifiedRole(), NewSecureViewerUnifiedRole(), } @@ -501,7 +501,7 @@ func displayName(role *conversions.Role) *string { displayName = canEdit case conversions.RoleFileEditor: displayName = canEdit - case conversions.RoleUploader: + case conversions.RoleEditorLite: displayName = "Can upload" case conversions.RoleManager: displayName = "Can manage" diff --git a/services/graph/pkg/unifiedrole/unifiedrole_test.go b/services/graph/pkg/unifiedrole/unifiedrole_test.go index b8d95e3ae..4dff7a68f 100644 --- a/services/graph/pkg/unifiedrole/unifiedrole_test.go +++ b/services/graph/pkg/unifiedrole/unifiedrole_test.go @@ -171,8 +171,8 @@ var _ = Describe("unifiedroles", func() { unifiedrole.UnifiedRoleConditionFolder, []*libregraph.UnifiedRoleDefinition{ unifiedrole.NewSecureViewerUnifiedRole(), - unifiedrole.NewUploaderUnifiedRole(), unifiedrole.NewViewerUnifiedRole(), + unifiedrole.NewEditorLiteUnifiedRole(), unifiedrole.NewEditorUnifiedRole(), }, ), @@ -194,8 +194,8 @@ var _ = Describe("unifiedroles", func() { unifiedrole.UnifiedRoleConditionFolder, []*libregraph.UnifiedRoleDefinition{ unifiedrole.NewSecureViewerUnifiedRole(), - unifiedrole.NewUploaderUnifiedRole(), unifiedrole.NewViewerUnifiedRole(), + unifiedrole.NewEditorLiteUnifiedRole(), unifiedrole.NewEditorUnifiedRole(), }, ), @@ -221,10 +221,11 @@ var _ = Describe("unifiedroles", func() { Entry( "mixed", - append(rolesToAction(unifiedrole.NewUploaderUnifiedRole()), unifiedrole.DriveItemQuotaRead), + append(rolesToAction(unifiedrole.NewEditorLiteUnifiedRole()), unifiedrole.DriveItemQuotaRead), unifiedrole.UnifiedRoleConditionFolder, []*libregraph.UnifiedRoleDefinition{ - unifiedrole.NewUploaderUnifiedRole(), + unifiedrole.NewSecureViewerUnifiedRole(), + unifiedrole.NewEditorLiteUnifiedRole(), }, ), ) diff --git a/tests/acceptance/features/apiSharingNg/listPermissions.feature b/tests/acceptance/features/apiSharingNg/listPermissions.feature index e1c1e662b..ee598dfc2 100644 --- a/tests/acceptance/features/apiSharingNg/listPermissions.feature +++ b/tests/acceptance/features/apiSharingNg/listPermissions.feature @@ -106,19 +106,19 @@ Feature: List a sharing permissions "description": { "type": "string", "enum": [ - "View, download and upload." + "View and download." ] }, "displayName": { "type": "string", "enum": [ - "Can upload" + "Can view" ] }, "id": { "type": "string", "enum": [ - "1c996275-f1c9-4e71-abdf-a42f6495e960" + "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5" ] } } @@ -141,19 +141,19 @@ Feature: List a sharing permissions "description": { "type": "string", "enum": [ - "View and download." + "View, download and upload." ] }, "displayName": { "type": "string", "enum": [ - "Can view" + "Can upload" ] }, "id": { "type": "string", "enum": [ - "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5" + "1c996275-f1c9-4e71-abdf-a42f6495e960" ] } } @@ -855,13 +855,13 @@ Feature: List a sharing permissions "const": 2 }, "description": { - "const": "View, download and upload." + "const": "View and download." }, "displayName": { - "const": "Can upload" + "const": "Can view" }, "id": { - "const": "1c996275-f1c9-4e71-abdf-a42f6495e960" + "const": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5" } } }, @@ -878,13 +878,13 @@ Feature: List a sharing permissions "const": 3 }, "description": { - "const": "View and download." + "const": "View, download and upload." }, "displayName": { - "const": "Can view" + "const": "Can upload" }, "id": { - "const": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5" + "const": "1c996275-f1c9-4e71-abdf-a42f6495e960" } } },