diff options
Diffstat (limited to 'app/services/boards')
-rw-r--r-- | app/services/boards/lists/update_service.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/services/boards/lists/update_service.rb b/app/services/boards/lists/update_service.rb index 2ddeb6f0bd8..ad96e42f756 100644 --- a/app/services/boards/lists/update_service.rb +++ b/app/services/boards/lists/update_service.rb @@ -4,10 +4,10 @@ module Boards module Lists class UpdateService < Boards::BaseService def execute(list) - return not_authorized if preferences? && !can_read?(list) - return not_authorized if position? && !can_admin?(list) + update_preferences_result = update_preferences(list) if can_read?(list) + update_position_result = update_position(list) if can_admin?(list) - if update_preferences(list) || update_position(list) + if update_preferences_result || update_position_result success(list: list) else error(list.errors.messages, 422) @@ -32,10 +32,6 @@ module Boards { collapsed: Gitlab::Utils.to_boolean(params[:collapsed]) } end - def not_authorized - error("Not authorized", 403) - end - def preferences? params.has_key?(:collapsed) end |