OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Use `Util.error` to construct failure result.
Pavel Balashov1491dc771338
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rbindex 3618235a868..c396e4585c9 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rb@@ -54,15 +54,15 @@ module Storages::Peripherals::StorageInteraction::Nextcloudwhen "100"ServiceResult.success(message: "User has been added successfully")when "101"- ServiceResult.failure(message: "No group specified")+ Util.error(:error, "No group specified")when "102"- ServiceResult.failure(message: "Group does not exist")+ Util.error(:error, "Group does not exist")when "103"- ServiceResult.failure(message: "User does not exist")+ Util.error(:error, "User does not exist")when "104"- ServiceResult.failure(message: "Insufficient privileges")+ Util.error(:error, "Insufficient privileges")when "105"- ServiceResult.failure(message: "Failed to add user to group")+ Util.error(:error, "Failed to add user to group")endwhen Net::HTTPMethodNotAllowedUtil.error(:not_allowed)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rbindex 3d62d12c30f..f95b53c6141 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rb@@ -54,15 +54,15 @@ module Storages::Peripherals::StorageInteraction::Nextcloudwhen "100"ServiceResult.success(message: "User has been removed from group")when "101"- ServiceResult.failure(message: "No group specified")+ Util.error(:error, "No group specified")when "102"- ServiceResult.failure(message: "Group does not exist")+ Util.error(:error, "Group does not exist")when "103"- ServiceResult.failure(message: "User does not exist")+ Util.error(:error, "User does not exist")when "104"- ServiceResult.failure(message: "Insufficient privileges")+ Util.error(:error, "Insufficient privileges")when "105"- ServiceResult.failure(message: "Failed to remove user from group")+ Util.error(:error, "Failed to remove user from group")endwhen Net::HTTPMethodNotAllowedUtil.error(:not_allowed)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rbindex 6d29fa133ef..add141ff236 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rb@@ -88,7 +88,7 @@ module Storages::Peripherals::StorageInteraction::Nextcloudif doc.xpath("/d:multistatus/d:response/d:propstat[d:status[text() = 'HTTP/1.1 200 OK']]/d:prop/nc:acl-list").present?ServiceResult.successelse- ServiceResult.failure+ Util.error(:error, "nc:acl properly has not been set for #{path}")endwhen Net::HTTPNotFoundUtil.error(:not_found)