From 990d3aa7ff9dfa05015d42a7447f8af0979f4e32 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 1 Sep 2021 16:17:18 +0200 Subject: [PATCH] add create space permission --- .../unreleased/create-space-permission.md | 5 ++++ settings/pkg/service/v0/settings.go | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 changelog/unreleased/create-space-permission.md diff --git a/changelog/unreleased/create-space-permission.md b/changelog/unreleased/create-space-permission.md new file mode 100644 index 00000000000..42b0133f874 --- /dev/null +++ b/changelog/unreleased/create-space-permission.md @@ -0,0 +1,5 @@ +Enhancement: add the create space permission + +In preparation for the upcoming spaces features a `Create Space` permission was added. + +https://github.com/owncloud/ocis/pull/2461 diff --git a/settings/pkg/service/v0/settings.go b/settings/pkg/service/v0/settings.go index 0c76da8ab9b..71f0593043b 100644 --- a/settings/pkg/service/v0/settings.go +++ b/settings/pkg/service/v0/settings.go @@ -24,6 +24,11 @@ const ( // SettingsManagementPermissionName is the hardcoded setting name for the settings management permission SettingsManagementPermissionName string = "settings-management" + // CreateSpacePermissionID is the hardcoded setting UUID for the create space permission + CreateSpacePermissionID string = "79e13b30-3e22-11eb-bc51-0b9f0bad9a58" + // CreateSpacePermissionName is the hardcoded setting name for the create space permission + CreateSpacePermissionName string = "create-space" + settingUUIDProfileLanguage = "aa8cfbe5-95d4-4f7e-a032-c3c01f5f062f" // AccountManagementPermissionID is the hardcoded setting UUID for the account management permission @@ -331,6 +336,24 @@ func generatePermissionRequests() []*settings.AddSettingToBundleRequest { }, }, }, + { + BundleId: BundleUUIDRoleAdmin, + Setting: &settings.Setting{ + Id: CreateSpacePermissionID, + Name: CreateSpacePermissionName, + DisplayName: "Create Space", + Description: "This permission allows to create new spaces.", + Resource: &settings.Resource{ + Type: settings.Resource_TYPE_SYSTEM, + }, + Value: &settings.Setting_PermissionValue{ + PermissionValue: &settings.Permission{ + Operation: settings.Permission_OPERATION_READWRITE, + Constraint: settings.Permission_CONSTRAINT_ALL, + }, + }, + }, + }, } }