2016-10-04 14:51:21 +00:00
|
|
|
# frozen_string_literal: true
|
2017-11-25 19:23:47 +00:00
|
|
|
|
2016-10-04 14:24:47 +00:00
|
|
|
class MetacodePolicy < ApplicationPolicy
|
|
|
|
def index?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def show?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def create?
|
|
|
|
user.is_admin
|
|
|
|
end
|
|
|
|
|
|
|
|
def update?
|
|
|
|
user.is_admin
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
class Scope < Scope
|
|
|
|
def resolve
|
|
|
|
scope.all
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|