Add new "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)

Fixes: #4196
This commit is contained in:
Ralf Haferkamp
2022-09-07 16:41:02 +02:00
committed by Ralf Haferkamp
parent 746a532a76
commit e5543d4465
2 changed files with 26 additions and 0 deletions

View File

@@ -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

View File

@@ -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,
},
},
},
},
}
}