diff --git a/changelog/unreleased/delete-orphaned-spaces.md b/changelog/unreleased/delete-orphaned-spaces.md new file mode 100644 index 00000000000..8b31078fa7c --- /dev/null +++ b/changelog/unreleased/delete-orphaned-spaces.md @@ -0,0 +1,6 @@ +Enhancement: Introduce "delete-all-spaces" permission + +This is assigned to the Admin role by default and allows to cleanup orphaned +spaces (e.g. where the owner as been deleted) + +https://github.com/owncloud/ocis/issues/4196 diff --git a/services/settings/pkg/store/defaults/defaults.go b/services/settings/pkg/store/defaults/defaults.go index e9a0d7de125..1511b606d38 100644 --- a/services/settings/pkg/store/defaults/defaults.go +++ b/services/settings/pkg/store/defaults/defaults.go @@ -48,6 +48,11 @@ const ( // DeleteHomeSpacesPermissionName is the hardcoded setting name for the delete home space permission DeleteHomeSpacesPermissionName string = "delete-all-home-spaces" + // DeleteAllSpacesPermissionID is the hardcoded setting UUID for the delete all spaces permission + DeleteAllSpacesPermissionID string = "fb60b004-c1fa-4f09-bf87-55ce7d46ac61" + // DeleteAllSpacesPermissionName is the hardcoded setting name for the delete all space permission + DeleteAllSpacesPermissionName string = "delete-all-spaces" + settingUUIDProfileLanguage = "aa8cfbe5-95d4-4f7e-a032-c3c01f5f062f" // AccountManagementPermissionID is the hardcoded setting UUID for the account management permission @@ -225,6 +230,21 @@ func generateBundleAdminRole() *settingsmsg.Bundle { }, }, }, + { + Id: DeleteAllSpacesPermissionID, + Name: DeleteAllSpacesPermissionName, + DisplayName: "Delete AllSpaces", + Description: "This permission allows to delete all spaces.", + Resource: &settingsmsg.Resource{ + Type: settingsmsg.Resource_TYPE_SYSTEM, + }, + Value: &settingsmsg.Setting_PermissionValue{ + PermissionValue: &settingsmsg.Permission{ + Operation: settingsmsg.Permission_OPERATION_DELETE, + Constraint: settingsmsg.Permission_CONSTRAINT_ALL, + }, + }, + }, }, } }