Actions
Feature #258
openAPIファイルのリファクタリング、BaseControllerで共通化
Start date:
02/21/2026
Due date:
02/21/2026 (Due in 10 days)
% Done:
0%
Estimated time:
4:00 h
Description
render json: { error: "Unauthorized" }, status: :forbiddenに対して
# API関連
def authorize_patient!(patient)
return true if current_pharmacist.admin? || patient.pharmacy_id == current_pharmacist.pharmacy_id
render json: { error: "Unauthorized" }, status: :forbidden
false
end
def authorize_pharmacy_id!(pharmacy_id)
return true if current_pharmacist.admin? || pharmacy_id == current_pharmacist.pharmacy_id
render json: { error: "Unauthorized" }, status: :forbidden
false
end
Actions