mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-07 21:55:20 +08:00
this should fix travis ci
This commit is contained in:
parent
1e8442e22e
commit
e5b7d68031
1 changed files with 8 additions and 2 deletions
|
@ -6,8 +6,8 @@ module Api
|
||||||
before_action :load_team
|
before_action :load_team
|
||||||
before_action :load_inventory
|
before_action :load_inventory
|
||||||
before_action :load_inventory_column, only: %i(show update destroy)
|
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
|
def index
|
||||||
columns = @inventory.repository_columns
|
columns = @inventory.repository_columns
|
||||||
.includes(:repository_list_items)
|
.includes(:repository_list_items)
|
||||||
|
@ -66,6 +66,12 @@ module Api
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_create_permissions
|
||||||
|
unless can_manage_repository?(@inventory)
|
||||||
|
render body: nil, status: :forbidden
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def inventory_column_params
|
def inventory_column_params
|
||||||
unless params.require(:data).require(:type) == 'inventory_columns'
|
unless params.require(:data).require(:type) == 'inventory_columns'
|
||||||
raise ActionController::BadRequest,
|
raise ActionController::BadRequest,
|
||||||
|
|
Loading…
Add table
Reference in a new issue