Sha256: a42f6934b3f897af873a13f553e070fce1d01b5be832663ee3048aca61215621
Contents?: true
Size: 586 Bytes
Versions: 15
Compression:
Stored size: 586 Bytes
Contents
# frozen_string_literal: true require 'ditty/policies/application_policy' module ProxES class PermissionPolicy < Ditty::ApplicationPolicy def create? user && user.super_admin? end def list? create? end def read? create? end def update? read? end def delete? create? end def permitted_attributes %i[verb pattern role_id user_id] end class Scope < Ditty::ApplicationPolicy::Scope def resolve user && user.super_admin? ? scope : scope.where(id: -1) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems