user upgrades: add upgrade code system.
Add a system for upgrading accounts using upgrade codes. Users purchase an upgrade code off-site then redeem it on-site to upgrade their account to Gold. Upgrade codes are randomly pre-generated and are one time use only. Codes have enough randomness that guessing a code is infeasible.
This commit is contained in:
15
app/policies/upgrade_code_policy.rb
Normal file
15
app/policies/upgrade_code_policy.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class UpgradeCodePolicy < ApplicationPolicy
|
||||
def index?
|
||||
user.is_owner?
|
||||
end
|
||||
|
||||
def redeem?
|
||||
true
|
||||
end
|
||||
|
||||
def upgrade?
|
||||
unbanned?
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user