2016-10-04 14:51:21 +00:00
|
|
|
# frozen_string_literal: true
|
2016-10-04 14:24:47 +00:00
|
|
|
class UserPolicy < ApplicationPolicy
|
|
|
|
def index?
|
2016-10-04 14:51:21 +00:00
|
|
|
true
|
2016-10-04 14:24:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def show?
|
2016-10-04 14:51:21 +00:00
|
|
|
true
|
2016-10-04 14:24:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def create?
|
2016-10-04 14:51:21 +00:00
|
|
|
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
|
2016-10-04 14:51:21 +00:00
|
|
|
scope.all
|
2016-10-04 14:24:47 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|