Project

General

Profile

Actions

Feature #258

closed

Feature #280: 薬剤師の複数薬局所属設定を実装

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

Added by 關山 和丈 3 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
02/21/2026
Due date:
02/21/2026
% Done:

0%

Estimated time:
4:00 h
Spent time:

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

Also available in: Atom PDF