metamaps--metamaps/app/policies/user_policy.rb
2017-11-25 11:23:47 -08:00

46 lines
515 B
Ruby

# frozen_string_literal: true
class UserPolicy < ApplicationPolicy
def index?
true
end
def show?
true
end
def create?
raise 'Create should be handled by Devise'
end
def update?
user == record
end
def destroy?
false
end
def details?
show?
end
def updatemetacodes?
update?
end
def update_metacode_focus?
update?
end
# API action
def current?
user == record
end
class Scope < Scope
def resolve
scope.all
end
end
end