This commit is contained in:
2026-08-25 14:49:23 +02:00
parent c802605525
commit 552fdbe3a4
40 changed files with 207 additions and 182 deletions
@@ -43,7 +43,7 @@ module WarpEngine
token = current_application_token
return true if token.nil? || token.unrestricted?
software = WarpEngine::Software.find_by(name: name)
software = WarpEngine::Software.kept.find_by(name: name)
return true if software.nil? || software.owner_id.nil?
software.owner_type == token.owner_type && software.owner_id == token.owner_id
@@ -53,7 +53,7 @@ module WarpEngine
token = current_application_token
return if token.nil? || token.unrestricted?
software = WarpEngine::Software.find_by(name: name)
software = WarpEngine::Software.kept.find_by(name: name)
return if software.nil? || software.owner_id.present?
software.update_columns(owner_type: token.owner_type, owner_id: token.owner_id)
@@ -1,3 +1,5 @@
require "warp_engine/access_denied"
module WarpEngine
class ApiController < ActionController::API
resource_description do
@@ -10,7 +12,7 @@ module WarpEngine
include WarpEngine::ApiErrorRendering
include WarpEngine::SubjectAuthentication
rescue_from WarpEngine::DownloadService::Denied do
rescue_from WarpEngine::AccessDenied do
render json: { error: "Forbidden" }, status: :forbidden
end