add create_copy perm check in cat asset commons user/lew/create_copy_perm_issue
authorLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Fri, 14 Apr 2023 13:54:08 +0000 (09:54 -0400)
committerLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Fri, 14 Apr 2023 13:54:08 +0000 (09:54 -0400)
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm

index 079fed6..74e392a 100644 (file)
@@ -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' } );