Sha256: b12a6c02c8a556beff76769fc97c5925aaa6c296cd8e748587003cf5391a7b61
Contents?: true
Size: 538 Bytes
Versions: 12
Compression:
Stored size: 538 Bytes
Contents
# frozen_string_literal: true module Maquina class UserPolicy < ApplicationPolicy def index? management? || admin? end def new? management? || admin? end def create? new? end def new_modal? new? end private relation_scope do |scope| if management? scope.where(management: management?) else scope.joins(memberships: :organization).where(maquina_organizations: {id: Maquina::Current.membership.organization.id}) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems