mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 21:05:10 +00:00
- USPS::IndiciumPolicy to check can_use_indicia? - HCB::IndiciumPurchaseService for disbursement + purchase flow - Add hcb_payment_account to letter_queues and usps_indicia - Wire HCB payment into LettersController#buy_indicia - Wire HCB payment into Letter::InstantQueue
23 lines
325 B
Ruby
23 lines
325 B
Ruby
class USPS::IndiciumPolicy < ApplicationPolicy
|
|
def create?
|
|
user&.can_use_indicia?
|
|
end
|
|
|
|
def index?
|
|
user_is_admin
|
|
end
|
|
|
|
def show?
|
|
user_is_admin
|
|
end
|
|
|
|
class Scope < ApplicationPolicy::Scope
|
|
def resolve
|
|
if user&.admin?
|
|
scope.all
|
|
else
|
|
scope.none
|
|
end
|
|
end
|
|
end
|
|
end
|