Skip to content

Commit

Permalink
Add new "delete-all-spaces" permission
Browse files Browse the repository at this point in the history
This is assigned to the Admin role by default and allows to cleanup
orphaned spaces (e.g. where the owner as been deleted)

Fixes: #4196
  • Loading branch information
rhafer committed Sep 7, 2022
1 parent 746a532 commit e5543d4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/delete-orphaned-spaces.md
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions services/settings/pkg/store/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
},
},
},
},
}
}
Expand Down

0 comments on commit e5543d4

Please sign in to comment.