metamaps--metamaps/app/policies/user_policy.rb

42 lines
466 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
2016-10-04 14:24:47 +00:00
class UserPolicy < ApplicationPolicy
def index?
true
2016-10-04 14:24:47 +00:00
end
def show?
true
2016-10-04 14:24:47 +00:00
end
def create?
raise 'Create should be handled by Devise'
2016-10-04 14:24:47 +00:00
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
2016-10-04 14:24:47 +00:00
end
end
end