Actions
Feature #258
closedFeature #280: 薬剤師の複数薬局所属設定を実装
APIファイルのリファクタリング、BaseControllerで共通化
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