Sha256: d128c98b5eee836641a62b95c1576eba7d477ac90312a8ea09d49f8b8d728c67
Contents?: true
Size: 586 Bytes
Versions: 10
Compression:
Stored size: 586 Bytes
Contents
# frozen_string_literal: true require 'proxes/policies/application_policy' module ProxES class RolePolicy < 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 [:name] end class Scope < ApplicationPolicy::Scope def resolve if user && user.super_admin? scope else scope.where(id: -1) end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems