The court shall have discretion to assess all or part of the expense incurred in implementing such security measures as costs to be paid by the party or parties or other person or persons determined by the court to have necessitated such security measures.