metamaps--metamaps/app/policies/user_policy.rb
2016-10-04 22:51:21 +08:00

41 lines
466 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
# API action
def current?
user == record
end
class Scope < Scope
def resolve
scope.all
end
end
end