Project

General

Profile

Actions

Feature #258

open

APIファイルのリファクタリング、BaseControllerで共通化

Added by 關山 和丈 28 days ago. Updated 28 days ago.

Status:
New
Priority:
Normal
Assignee:
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 #1

Updated by 關山 和丈 28 days ago

  • Tracker changed from Bug to Feature
  • Description updated (diff)
Actions #2

Updated by 關山 和丈 28 days ago

  • Description updated (diff)
Actions

Also available in: Atom PDF