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

46 lines
514 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
2017-02-05 06:28:10 +00:00
def update_metacode_focus?
update?
end
2016-10-04 14:24:47 +00:00
# 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