From: Llewellyn Marshall Date: Fri, 14 Apr 2023 13:54:08 +0000 (-0400) Subject: add create_copy perm check in cat asset commons X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Flew%2Fcreate_copy_perm_issue;p=working%2FEvergreen.git add create_copy perm check in cat asset commons --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm index 079fed631e..74e392aa67 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm @@ -50,6 +50,9 @@ sub fix_copy_price { sub create_copy { my($class, $editor, $vol, $copy) = @_; + return $editor->event unless + $editor->allowed('CREATE_COPY', $class->copy_perm_org($vol, $copy)); + my $existing = $editor->search_asset_copy( { barcode => $copy->barcode, deleted => 'f' } );