Compare commits

...
24 Commits
Author SHA1 Message Date
Julian Koberg af2f7cdce5 feat: release 7.2.0 "Addams"
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2025-07-14 11:03:25 +02:00
Deyan Zhekov 75479940f6 Automated changelog update [skip ci] 2025-07-13 21:18:14 +00:00
Deyan Zhekov 03a33ec434 Merge pull request #11519 from owncloud/release-7.2.0-rc.2
[full-ci][k6-test] Release 7.2.0-rc.2
2025-07-14 00:17:45 +03:00
Deyan Zhekov 4dbecb4ea4 feat(ocis): release 7.2.0-rc.2 2025-07-11 16:52:48 +03:00
Roman Perekhod 97a7fcb5f0 Automated changelog update [skip ci] 2025-07-08 17:01:13 +00:00
Roman Perekhod 2078d5971b Merge pull request #11494 from 2403905/OCISDEV-154
backport: [OCISDEV-154] Clean up the unified roles label
2025-07-08 19:00:43 +02:00
Roman Perekhod 20b5e24eed chore: [OCISDEV-154] Clean up the unified roles label 2025-07-08 16:52:59 +02:00
Roman Perekhod e6c3458206 Merge pull request #11492 from owncloud/backport-fix-deploy
backport: Fix debug docker for collabora and onlyoffice in example full deployment
2025-07-03 13:46:59 +02:00
kobergj 34ea1d4182 Automated changelog update [skip ci] 2025-07-03 11:03:09 +00:00
Roman Perekhod 83c3651092 backport: Fix debug docker for collabora and onlyoffice in example full deployment 2025-07-03 12:57:16 +02:00
kobergj 7b59ac8ed2 Merge pull request #11489 from owncloud/backport-OCISDEV-151
backport: [OCISDEV-151] the watermark is visible to user with a `viewer role` in Collabora
2025-07-03 12:51:49 +02:00
kobergj 59e2345dda Merge pull request #11487 from kobergj/FixDeploymentExample
backport: Fix collabora and onlyoffice in example full deployment
2025-07-03 12:38:40 +02:00
kobergj 0e3d08d779 Automated changelog update [skip ci] 2025-07-03 10:34:06 +00:00
kobergj 1e440f954c Merge pull request #11490 from owncloud/backport-OCISDEV-141
Backport [OCISDEV-141]
2025-07-03 12:33:32 +02:00
Roman Perekhod 2296f4af0a [OCISDEV-141] Fix storage-users cli
(cherry picked from commit 443c8b6675)
2025-07-03 10:54:14 +02:00
Roman Perekhod 489a98e61d fix: [OCISDEV-151] the watermark is visible to user with a viewer role in Collabora
(cherry picked from commit b0c3d60cc1)
2025-07-03 10:51:05 +02:00
Daan Breur c381e590f6 Update collabora.yml 2025-07-03 09:49:35 +02:00
Daan Breur d5e6c4e14b Update onlyoffice.yml 2025-07-03 09:49:22 +02:00
Deyan Zhekov a4dd1d6b64 Automated changelog update [skip ci] 2025-06-25 10:37:45 +00:00
Deyan Zhekov bda6c89587 Merge pull request #11463 from owncloud/fix/stable-7.2-changelog-issue
[full-ci] Fix changelog issue in drone.star
2025-06-25 13:36:38 +03:00
Deyan Zhekov 5408f4523f Fix the value for target_branch 2025-06-25 12:32:46 +03:00
Deyan Zhekov 12b2fd0370 Add "refs/heads/stable-*" to drone.star 2025-06-25 12:20:04 +03:00
kobergj a51f90e2e7 Merge pull request #11449 from owncloud/release-7.2.0-rc.1
[full-ci][k6-test] Release 7.2.0-rc.1
2025-06-23 11:39:38 +02:00
Julian Koberg f394332832 feat(ocis): release 7.2.0-rc.1
Signed-off-by: Julian Koberg <julian.koberg@kiteworks.com>
2025-06-20 10:52:07 +02:00
59 changed files with 273 additions and 78 deletions

No files matched your search

+29 -2
View File
@@ -545,6 +545,7 @@ def cachePipeline(name, steps):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/**",
"refs/pull/**",
],
@@ -738,6 +739,7 @@ def testOcis(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -770,6 +772,7 @@ def scanOcis(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -795,6 +798,7 @@ def buildOcisBinaryForTesting(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -882,6 +886,7 @@ def uploadScanResults(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
"status": [
@@ -1025,6 +1030,7 @@ def codestyle(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1092,6 +1098,7 @@ def localApiTestPipeline(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1199,6 +1206,7 @@ def cs3ApiTests(ctx, storage):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1317,6 +1325,7 @@ def wopiValidatorTests(ctx, storage, wopiServerType):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1404,6 +1413,7 @@ def coreApiTestPipeline(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -1434,6 +1444,7 @@ def e2eTestPipeline(ctx):
e2e_trigger = {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/**",
"refs/pull/**",
],
@@ -1576,6 +1587,7 @@ def multiServiceE2ePipeline(ctx):
e2e_trigger = {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
}
@@ -1860,6 +1872,7 @@ def dockerRelease(ctx, arch, repo, build_type):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
"refs/pull/**",
],
@@ -1967,6 +1980,7 @@ def binaryRelease(ctx, arch, build_type, target, depends_on = []):
"when": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -1978,6 +1992,7 @@ def binaryRelease(ctx, arch, build_type, target, depends_on = []):
"when": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -2021,6 +2036,7 @@ def binaryRelease(ctx, arch, build_type, target, depends_on = []):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
"refs/pull/**",
],
@@ -2113,6 +2129,7 @@ def licenseCheck(ctx):
"when": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -2155,6 +2172,7 @@ def licenseCheck(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
"refs/pull/**",
],
@@ -2222,6 +2240,7 @@ def releaseDockerManifest(ctx, repo, build_type):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -2268,7 +2287,7 @@ def changelog():
"push",
],
"message": "Automated changelog update [skip ci]",
"branch": "master",
"branch": "stable-7.2",
"author_email": "devops@owncloud.com",
"author_name": "ownClouders",
"netrc_machine": "github.com",
@@ -2291,6 +2310,7 @@ def changelog():
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
"event": {
@@ -2330,6 +2350,7 @@ def releaseDockerReadme(ctx, repo, build_type):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -2379,7 +2400,7 @@ def docs():
},
"pages_directory": "docs/hugo/content/",
"copy_contents": "true",
"target_branch": "docs",
"target_branch": "docs-stable-7.2",
"delete": "true",
},
"when": {
@@ -2402,6 +2423,7 @@ def docs():
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
@@ -2471,6 +2493,7 @@ def notify(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/heads/release*",
"refs/tags/**",
],
@@ -2814,6 +2837,7 @@ def deploy(ctx, config, rebuild):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/v*",
],
},
@@ -2940,6 +2964,7 @@ def uploadAPITestCoverageReport(ctx):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
],
"status": [
"success",
@@ -2974,6 +2999,7 @@ def genericCachePurge(flush_path):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
"status": [
@@ -3167,6 +3193,7 @@ def litmus(ctx, storage):
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/pull/**",
],
},
+64 -25
View File
@@ -1,6 +1,7 @@
# Table of Contents
* [Changelog for unreleased](#changelog-for-unreleased-unreleased)
* [Changelog for 7.2.0-rc.2](#changelog-for-720-rc2-2025-07-09)
* [Changelog for 7.2.0-rc.1](#changelog-for-720-rc1-2025-06-20)
* [Changelog for 7.1.3](#changelog-for-713-2025-05-27)
* [Changelog for 7.1.2](#changelog-for-712-2025-03-28)
* [Changelog for 7.1.1](#changelog-for-711-2025-03-14)
@@ -35,8 +36,8 @@
* [Changelog for 3.0.0](#changelog-for-300-2023-06-06)
* [Changelog for 2.0.0](#changelog-for-200-2022-11-30)
* [Changelog for 1.20.0](#changelog-for-1200-2022-04-13)
* [Changelog for 1.19.0](#changelog-for-1190-2022-03-29)
* [Changelog for 1.19.1](#changelog-for-1191-2022-03-29)
* [Changelog for 1.19.0](#changelog-for-1190-2022-03-29)
* [Changelog for 1.18.0](#changelog-for-1180-2022-03-03)
* [Changelog for 1.17.0](#changelog-for-1170-2022-02-16)
* [Changelog for 1.16.0](#changelog-for-1160-2021-12-10)
@@ -57,11 +58,49 @@
* [Changelog for 1.1.0](#changelog-for-110-2021-01-22)
* [Changelog for 1.0.0](#changelog-for-100-2020-12-17)
# Changelog for [unreleased] (UNRELEASED)
# Changelog for [7.2.0-rc.2] (2025-07-09)
The following sections list the changes for unreleased.
The following sections list the changes for 7.2.0-rc.2.
[unreleased]: https://github.com/owncloud/ocis/compare/v7.1.3...master
[7.2.0-rc.2]: https://github.com/owncloud/ocis/compare/v7.2.0-rc.1...v7.2.0-rc.2
## Summary
* Bugfix - Fix the OCM role editor: [#11484](https://github.com/owncloud/ocis/pull/11484)
* Bugfix - Fix storage-users cli: [#11490](https://github.com/owncloud/ocis/pull/11490)
* Bugfix - Clean up unified roles label: [#11494](https://github.com/owncloud/ocis/pull/11494)
## Details
* Bugfix - Fix the OCM role editor: [#11484](https://github.com/owncloud/ocis/pull/11484)
Fix the issue when the watermark is visible to user with a viewer role in
Collabora
https://github.com/owncloud/ocis/issues/11474
https://github.com/owncloud/ocis/pull/11484
* Bugfix - Fix storage-users cli: [#11490](https://github.com/owncloud/ocis/pull/11490)
Fix storage-users uploads --resume command.
https://github.com/owncloud/ocis/issues/11290
https://github.com/owncloud/ocis/pull/11490
* Bugfix - Clean up unified roles label: [#11494](https://github.com/owncloud/ocis/pull/11494)
Clean up the unified roles label
https://github.com/owncloud/ocis/issues/11470
https://github.com/owncloud/ocis/issues/11254
https://github.com/owncloud/ocis/issues/10082
https://github.com/owncloud/ocis/pull/11494
# Changelog for [7.2.0-rc.1] (2025-06-20)
The following sections list the changes for 7.2.0-rc.1.
[7.2.0-rc.1]: https://github.com/owncloud/ocis/compare/v7.1.3...v7.2.0-rc.1
## Summary
@@ -11720,7 +11759,7 @@ The following sections list the changes for 2.0.0.
The following sections list the changes for 1.20.0.
[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0
[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0
## Summary
@@ -11894,11 +11933,29 @@ The following sections list the changes for 1.20.0.
https://github.com/owncloud/ocis/pull/3509
https://github.com/owncloud/web/releases/tag/v5.4.0
# Changelog for [1.19.1] (2022-03-29)
The following sections list the changes for 1.19.1.
[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1
## Summary
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
## Details
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
URLs for Special items (space image, readme) were broken.
https://github.com/owncloud/ocis/pull/3419
# Changelog for [1.19.0] (2022-03-29)
The following sections list the changes for 1.19.0.
[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0
[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0
## Summary
@@ -12072,24 +12129,6 @@ The following sections list the changes for 1.19.0.
https://github.com/owncloud/ocis/pull/3375
https://github.com/owncloud/web/releases/tag/v5.3.0
# Changelog for [1.19.1] (2022-03-29)
The following sections list the changes for 1.19.1.
[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1
## Summary
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
## Details
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
URLs for Special items (space image, readme) were broken.
https://github.com/owncloud/ocis/pull/3419
# Changelog for [1.18.0] (2022-03-03)
The following sections list the changes for 1.18.0.
File renamed without changes.
@@ -0,0 +1,6 @@
Bugfix: Fix storage-users cli
Fix storage-users uploads --resume command.
https://github.com/owncloud/ocis/pull/11490
https://github.com/owncloud/ocis/issues/11290
@@ -0,0 +1,8 @@
Bugfix: Clean up unified roles label
Clean up the unified roles label
https://github.com/owncloud/ocis/pull/11494
https://github.com/owncloud/ocis/issues/11470
https://github.com/owncloud/ocis/issues/11254
https://github.com/owncloud/ocis/issues/10082
@@ -0,0 +1,6 @@
Bugfix: Fix the OCM role editor
Fix the issue when the watermark is visible to user with a viewer role in Collabora
https://github.com/owncloud/ocis/pull/11484
https://github.com/owncloud/ocis/issues/11474
+1 -1
View File
@@ -20,7 +20,7 @@ services:
condition: service_started
collabora:
condition: service_healthy
command: ["ocis", "collaboration", "server"]
command: ["collaboration", "server"]
environment:
COLLABORATION_GRPC_ADDR: 0.0.0.0:9301
COLLABORATION_HTTP_ADDR: 0.0.0.0:9300
@@ -1,9 +1,11 @@
---
services:
collaboration-oo:
command: [ "-c", "dlv --listen=:40002 --headless=true --continue --check-go-version=false --api-version=2 --accept-multiclient exec /usr/bin/ocis collaboration server" ]
collaboration:
entrypoint:
- /bin/sh
command: [ "-c", "dlv --listen=:40000 --headless=true --continue --check-go-version=false --api-version=2 --accept-multiclient exec /usr/bin/ocis collaboration server" ]
environment:
COLLABORATION_LOG_LEVEL: debug
ports:
- 40002:40002
- 40002:40000
@@ -1,7 +1,9 @@
---
services:
collaboration:
collaboration-oo:
entrypoint:
- /bin/sh
command: [ "-c", "dlv --listen=:40000 --headless=true --continue --check-go-version=false --api-version=2 --accept-multiclient exec /usr/bin/ocis collaboration server" ]
environment:
COLLABORATION_LOG_LEVEL: debug
@@ -15,7 +15,7 @@ services:
condition: service_started
onlyoffice:
condition: service_healthy
command: ["ocis", "collaboration", "server"]
command: ["collaboration", "server"]
environment:
COLLABORATION_GRPC_ADDR: 0.0.0.0:9301
COLLABORATION_HTTP_ADDR: 0.0.0.0:9300
@@ -56,7 +56,7 @@ services:
# run ocis init to initialize a configuration file with random secrets
# it will fail on subsequent runs, because the config file already exists
# therefore we ignore the error and then start the ocis server
command: ["-c", "ocis init || true; exec ocis server"]
command: [ "-c", "ocis init || true; exec ocis server" ]
environment:
# Keycloak IDP specific configuration
PROXY_AUTOPROVISION_ACCOUNTS: "true"
+1 -1
View File
@@ -16,7 +16,7 @@ var (
// LatestTag is the latest released version plus the dev meta version.
// Will be overwritten by the release pipeline
// Needs a manual change for every tagged release
LatestTag = "7.1.3+dev"
LatestTag = "7.2.0"
// Date indicates the build date.
// This has been removed, it looks like you can only replace static strings with recent go versions
@@ -1308,7 +1308,7 @@ func (f *FileConnector) CheckFileInfo(ctx context.Context) (*ConnectorResponse,
infoMap[fileinfo.KeyDisableExport] = true // only for collabora
infoMap[fileinfo.KeyDisableCopy] = true // only for collabora
infoMap[fileinfo.KeyDisablePrint] = true
if !isPublicShare {
if !isPublicShare && wopiContext.ViewOnlyToken != "" {
infoMap[fileinfo.KeyWatermarkText] = f.watermarkText(user) // only for collabora
}
}
@@ -1983,6 +1983,78 @@ var _ = Describe("FileConnector", func() {
cfg.App.Name = "Collabora"
cfg.App.Product = "Collabora"
expectedFileInfo := &fileinfo.Collabora{
OwnerID: "61616262636340637573746f6d496470", // hex of aabbcc@customIdp
Size: int64(998877),
BaseFileName: "test.txt",
UserCanNotWriteRelative: false,
DisableExport: true,
DisableCopy: true,
DisablePrint: true,
UserID: hex.EncodeToString([]byte("aabbcc@example.com")),
UserFriendlyName: "Pet Shaft",
EnableOwnerTermination: true,
WatermarkText: "",
SupportsLocks: true,
SupportsRename: true,
UserCanRename: false,
BreadcrumbDocName: "test.txt",
PostMessageOrigin: "https://ocis.example.prv",
}
response, err := fc.CheckFileInfo(ctx)
Expect(err).ToNot(HaveOccurred())
Expect(response.Status).To(Equal(200))
Expect(response.Body.(*fileinfo.Collabora)).To(Equal(expectedFileInfo))
})
It("Stat success secure view authenticated user", func() {
// change view mode to view only
wopiCtx.ViewMode = appproviderv1beta1.ViewMode_VIEW_MODE_VIEW_ONLY
wopiCtx.ViewOnlyToken = "ABC123"
ctx := middleware.WopiContextToCtx(context.Background(), wopiCtx)
u := &userv1beta1.User{
Id: &userv1beta1.UserId{
Idp: "example.com",
OpaqueId: "aabbcc",
Type: userv1beta1.UserType_USER_TYPE_PRIMARY,
},
DisplayName: "Pet Shaft",
Mail: "shaft@example.com",
}
ctx = ctxpkg.ContextSetUser(ctx, u)
gatewayClient.On("Stat", mock.Anything, mock.Anything).Times(1).Return(&providerv1beta1.StatResponse{
Status: status.NewOK(ctx),
Info: &providerv1beta1.ResourceInfo{
Owner: &userv1beta1.UserId{
Idp: "customIdp",
OpaqueId: "aabbcc",
Type: userv1beta1.UserType_USER_TYPE_PRIMARY,
},
Size: uint64(998877),
Mtime: &typesv1beta1.Timestamp{
Seconds: uint64(16273849),
},
Path: "/path/to/test.txt",
Id: &providerv1beta1.ResourceId{
StorageId: "storageid",
OpaqueId: "opaqueid",
SpaceId: "spaceid",
},
ParentId: &providerv1beta1.ResourceId{
StorageId: "storageid",
OpaqueId: "parentopaqueid",
SpaceId: "spaceid",
},
},
}, nil)
// change wopi app provider
cfg.App.Name = "Collabora"
cfg.App.Product = "Collabora"
expectedFileInfo := &fileinfo.Collabora{
OwnerID: "61616262636340637573746f6d496470", // hex of aabbcc@customIdp
Size: int64(998877),
+2 -19
View File
@@ -14,23 +14,6 @@ import (
"github.com/owncloud/ocis/v2/services/graph/pkg/unifiedrole"
)
var (
unifiedRolesNames = map[string]string{
unifiedrole.UnifiedRoleViewerID: "Viewer",
unifiedrole.UnifiedRoleViewerListGrantsID: "ViewerListGrants",
unifiedrole.UnifiedRoleSpaceViewerID: "SpaceViewer",
unifiedrole.UnifiedRoleEditorID: "Editor",
unifiedrole.UnifiedRoleEditorListGrantsID: "EditorListGrants",
unifiedrole.UnifiedRoleSpaceEditorID: "SpaceEditor",
unifiedrole.UnifiedRoleSpaceEditorWithoutVersionsID: "SpaceEditorWithoutVersions",
unifiedrole.UnifiedRoleFileEditorID: "FileEditor",
unifiedrole.UnifiedRoleFileEditorListGrantsID: "FileEditorListGrants",
unifiedrole.UnifiedRoleEditorLiteID: "EditorLite",
unifiedrole.UnifiedRoleManagerID: "SpaceManager",
unifiedrole.UnifiedRoleSecureViewerID: "SecureViewer",
}
)
// UnifiedRoles bundles available commands for unified roles
func UnifiedRoles(cfg *config.Config) cli.Commands {
cmds := cli.Commands{
@@ -58,7 +41,7 @@ func listUnifiedRoles(cfg *config.Config) *cli.Command {
tbl.SetRowLine(true)
tbl.SetAutoMergeCellsByColumnIndex([]int{0}) // rowspan should only affect the first column
headers := []string{"Name", "UID", "Enabled", "Description", "Condition", "Allowed resource actions"}
headers := []string{"Label", "UID", "Enabled", "Description", "Condition", "Allowed resource actions"}
tbl.SetHeader(headers)
for _, definition := range unifiedrole.GetRoles(unifiedrole.RoleFilterAll()) {
@@ -66,7 +49,7 @@ func listUnifiedRoles(cfg *config.Config) *cli.Command {
const disabled = "disabled"
rows := [][]string{
{unifiedRolesNames[definition.GetId()], definition.GetId(), disabled, definition.GetDescription()},
{unifiedrole.GetUnifiedRoleLabel(definition.GetId()), definition.GetId(), disabled, definition.GetDescription()},
}
if slices.Contains(cfg.UnifiedRoles.AvailableRoles, definition.GetId()) {
rows[0][2] = enabled
+25
View File
@@ -193,6 +193,26 @@ var (
// UnifiedRole FullDenial, Role DisplayName (resolves directly)
_deniedUnifiedRoleDisplayName = l10n.Template("Cannot access")
// unifiedRoleLabel contains the mapping of unified role IDs to their labels.
unifiedRoleLabel = map[string]string{
UnifiedRoleViewerID: "Viewer",
UnifiedRoleViewerListGrantsID: "ViewerListGrants",
UnifiedRoleSpaceViewerID: "SpaceViewer",
UnifiedRoleEditorID: "Editor",
UnifiedRoleEditorListGrantsID: "EditorListGrants",
UnifiedRoleEditorListGrantsWithVersionsID: "EditorListGrantsWithVersions",
UnifiedRoleSpaceEditorID: "SpaceEditor",
UnifiedRoleSpaceEditorWithoutVersionsID: "SpaceEditorWithoutVersions",
UnifiedRoleSpaceEditorWithoutTrashbinID: "SpaceEditorWithoutTrashbin",
UnifiedRoleFileEditorID: "FileEditor",
UnifiedRoleFileEditorListGrantsID: "FileEditorListGrants",
UnifiedRoleFileEditorListGrantsWithVersionsID: "FileEditorListGrantsWithVersions",
UnifiedRoleEditorLiteID: "EditorLite",
UnifiedRoleManagerID: "Manager",
UnifiedRoleSecureViewerID: "SecureViewer",
UnifiedRoleDeniedID: "Denied",
}
// legacyNames contains the legacy role names.
legacyNames = map[string]string{
UnifiedRoleViewerID: conversions.RoleViewer,
@@ -596,6 +616,11 @@ func GetRolesByPermissions(roleSet []*libregraph.UnifiedRoleDefinition, actions
return weightRoles(roles, constraints, descending)
}
// GetUnifiedRoleLabel returns the label for the provided unified role ID
func GetUnifiedRoleLabel(unifiedRoleId string) string {
return unifiedRoleLabel[unifiedRoleId]
}
// GetLegacyRoleName returns the legacy role name for the provided role
func GetLegacyRoleName(role libregraph.UnifiedRoleDefinition) string {
return legacyNames[role.GetId()]
@@ -270,3 +270,32 @@ func TestGetAllowedResourceActions(t *testing.T) {
})
}
}
func TestGetUnifiedRoleLabel(t *testing.T) {
type args struct {
unifiedRoleId string
}
tests := []struct {
name string
args args
want string
}{
{
name: "Empty",
args: args{unifiedRoleId: ""},
want: "",
},
{
name: "Unknown",
args: args{unifiedRoleId: "unknown"},
want: "",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := unifiedrole.GetUnifiedRoleLabel(tt.args.unifiedRoleId); got != tt.want {
t.Errorf("GetUnifiedRoleLabel() = %v, want %v", got, tt.want)
}
})
}
}
@@ -131,7 +131,7 @@ func ListUploadSessions(cfg *config.Config) *cli.Command {
}
var stream events.Stream
if c.Bool("restart") {
if c.Bool("restart") || c.Bool("resume") {
stream, err = event.NewStream(cfg)
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to create event stream: %v\n", err)
+1 -1
View File
@@ -70,5 +70,5 @@ func TestService_Get(t *testing.T) {
// brandingTheme
assert.Equal(t, jsonData.Get("_branding").String(), "_branding")
// themeDefaults
assert.Equal(t, jsonData.Get("common.shareRoles."+unifiedrole.UnifiedRoleViewerID+".name").String(), "UnifiedRoleViewer")
assert.Equal(t, jsonData.Get("common.shareRoles."+unifiedrole.UnifiedRoleViewerID+".label").String(), "Viewer")
}
+16 -16
View File
@@ -18,67 +18,67 @@ var themeDefaults = KV{
"common": KV{
"shareRoles": KV{
unifiedrole.UnifiedRoleViewerID: KV{
"name": "UnifiedRoleViewer",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleViewerID),
"iconName": "eye",
},
unifiedrole.UnifiedRoleViewerListGrantsID: KV{
"name": "UnifiedRoleViewerListGrants",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleViewerListGrantsID),
"iconName": "eye",
},
unifiedrole.UnifiedRoleSpaceViewerID: KV{
"label": "UnifiedRoleSpaceViewer",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleSpaceViewerID),
"iconName": "eye",
},
unifiedrole.UnifiedRoleFileEditorID: KV{
"label": "UnifiedRoleFileEditor",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleFileEditorID),
"iconName": "pencil",
},
unifiedrole.UnifiedRoleFileEditorListGrantsID: KV{
"label": "UnifiedRoleFileEditorListGrants",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleFileEditorListGrantsID),
"iconName": "pencil",
},
unifiedrole.UnifiedRoleFileEditorListGrantsWithVersionsID: KV{
"label": "UnifiedRoleFileEditorListGrantsWithVersions",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleFileEditorListGrantsWithVersionsID),
"iconName": "pencil",
},
unifiedrole.UnifiedRoleEditorID: KV{
"label": "UnifiedRoleEditor",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleEditorID),
"iconName": "pencil",
},
unifiedrole.UnifiedRoleEditorListGrantsID: KV{
"label": "UnifiedRoleEditorListGrants",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleEditorListGrantsID),
"iconName": "pencil",
},
unifiedrole.UnifiedRoleEditorListGrantsWithVersionsID: KV{
"label": "UnifiedRoleEditorListGrantsWithVersions",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleEditorListGrantsWithVersionsID),
"iconName": "pencil",
},
unifiedrole.UnifiedRoleSpaceEditorID: KV{
"label": "UnifiedRoleSpaceEditor",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleSpaceEditorID),
"iconName": "pencil",
},
unifiedrole.UnifiedRoleSpaceEditorWithoutVersionsID: KV{
"label": "UnifiedRoleSpaceEditorWithoutVersions",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleSpaceEditorWithoutVersionsID),
"iconName": "pencil",
},
unifiedrole.UnifiedRoleSpaceEditorWithoutTrashbinID: KV{
"label": "UnifiedRoleSpaceEditorWithoutTrashbin",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleSpaceEditorWithoutTrashbinID),
"iconName": "pencil",
},
unifiedrole.UnifiedRoleManagerID: KV{
"label": "UnifiedRoleManager",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleManagerID),
"iconName": "user-star",
},
unifiedrole.UnifiedRoleEditorLiteID: KV{
"label": "UnifiedRoleEditorLite",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleEditorLiteID),
"iconName": "upload",
},
unifiedrole.UnifiedRoleSecureViewerID: KV{
"label": "UnifiedRoleSecureView",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleSecureViewerID),
"iconName": "shield",
},
unifiedrole.UnifiedRoleDeniedID: KV{
"label": "UnifiedRoleFullDenial",
"label": unifiedrole.GetUnifiedRoleLabel(unifiedrole.UnifiedRoleDeniedID),
"iconName": "stop-circle",
},
},
+1 -1
View File
@@ -2,7 +2,7 @@
sonar.projectKey=owncloud_ocis
sonar.organization=owncloud-1
sonar.projectName=ocis
sonar.projectVersion=7.1.3
sonar.projectVersion=7.2.0
sonar.host.url=https://sonarcloud.io
# =====================================================
@@ -393,9 +393,5 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiSharingNgDriveLinkShare/createInternalLinkShare.feature:339](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgDriveLinkShare/createInternalLinkShare.feature#L339)
#### [[CLI] Error while resuming an upload](https://github.com/owncloud/ocis/issues/11290)
- [cliCommands/uploadSessions.feature:162](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/cliCommands/uploadSessions.feature#L162)
Note: always have an empty line at the end of this file.
The bash script that processes this file requires that the last line has a newline on the end.