Sha256: 5f1d047db182ea296d7e9f44f6f264d3c6d119bc67f43e45ac1cb2d12552eb2a
Contents?: true
Size: 691 Bytes
Versions: 89
Compression:
Stored size: 691 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/clinics" module Renalware module Clinics class ClinicVisitPolicy < BasePolicy def destroy? return false unless record.persisted? record.created_at > Renalware.config.new_clinic_visit_deletion_window.ago && (user_created_record? || user_is_super_admin?) end def edit? return false unless record.persisted? record.created_at > Renalware.config.new_clinic_visit_edit_window.ago && (user_created_record? || user_is_super_admin?) end private def user_created_record? record.created_by_id == user.id end end end end
Version data entries
89 entries across 89 versions & 1 rubygems