add delete home space permission to admin role
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -252,6 +252,9 @@ func (g Graph) DeleteUser(w http.ResponseWriter, r *http.Request) {
|
|||||||
for _, sp := range lspr.GetStorageSpaces() {
|
for _, sp := range lspr.GetStorageSpaces() {
|
||||||
if sp.SpaceType == "personal" {
|
if sp.SpaceType == "personal" {
|
||||||
if sp.Owner.Id.OpaqueId == userID {
|
if sp.Owner.Id.OpaqueId == userID {
|
||||||
|
// TODO: check if request contains a homespace and if, check if requesting user has the privilege to
|
||||||
|
// delete it and make sure it is not deleting its own homespace
|
||||||
|
// needs modification of the cs3api
|
||||||
_, err := g.gatewayClient.DeleteStorageSpace(r.Context(), &storageprovider.DeleteStorageSpaceRequest{
|
_, err := g.gatewayClient.DeleteStorageSpace(r.Context(), &storageprovider.DeleteStorageSpaceRequest{
|
||||||
Opaque: opaque,
|
Opaque: opaque,
|
||||||
Id: &storageprovider.StorageSpaceId{
|
Id: &storageprovider.StorageSpaceId{
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ const (
|
|||||||
// CreateSpacePermissionName is the hardcoded setting name for the create space permission
|
// CreateSpacePermissionName is the hardcoded setting name for the create space permission
|
||||||
CreateSpacePermissionName string = "create-space"
|
CreateSpacePermissionName string = "create-space"
|
||||||
|
|
||||||
|
// DeleteHomeSpacesPermissionID is the hardcoded setting UUID for the delete home space permission
|
||||||
|
DeleteHomeSpacesPermissionID string = "5de9fe0a-4bc5-4a47-b758-28f370caf169"
|
||||||
|
// DeleteHomeSpacesPermissionName is the hardcoded setting name for the delete home space permission
|
||||||
|
DeleteHomeSpacesPermissionName string = "delete-all-home-spaces"
|
||||||
|
|
||||||
settingUUIDProfileLanguage = "aa8cfbe5-95d4-4f7e-a032-c3c01f5f062f"
|
settingUUIDProfileLanguage = "aa8cfbe5-95d4-4f7e-a032-c3c01f5f062f"
|
||||||
|
|
||||||
// AccountManagementPermissionID is the hardcoded setting UUID for the account management permission
|
// AccountManagementPermissionID is the hardcoded setting UUID for the account management permission
|
||||||
@@ -205,6 +210,21 @@ func generateBundleAdminRole() *settingsmsg.Bundle {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Id: DeleteHomeSpacesPermissionID,
|
||||||
|
Name: DeleteHomeSpacesPermissionName,
|
||||||
|
DisplayName: "Delete All Home Spaces",
|
||||||
|
Description: "This permission allows to delete home 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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user