From e5b7d6803118c2ae910b7612f64f4cce63c92033 Mon Sep 17 00:00:00 2001 From: Zanz2 Date: Mon, 24 Sep 2018 13:33:44 +0200 Subject: [PATCH] this should fix travis ci --- app/controllers/api/v1/inventory_columns_controller.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/inventory_columns_controller.rb b/app/controllers/api/v1/inventory_columns_controller.rb index 7ae1d5fba..2600c3744 100644 --- a/app/controllers/api/v1/inventory_columns_controller.rb +++ b/app/controllers/api/v1/inventory_columns_controller.rb @@ -6,8 +6,8 @@ module Api before_action :load_team before_action :load_inventory before_action :load_inventory_column, only: %i(show update destroy) - before_action :check_manage_permissions, only: %i(create update destroy) - + before_action :check_manage_permissions, only: %i(update destroy) + before_action :check_create_permissions, only: %i(create) def index columns = @inventory.repository_columns .includes(:repository_list_items) @@ -66,6 +66,12 @@ module Api end end + def check_create_permissions + unless can_manage_repository?(@inventory) + render body: nil, status: :forbidden + end + end + def inventory_column_params unless params.require(:data).require(:type) == 'inventory_columns' raise ActionController::BadRequest,