View | Details | Raw Unified | Return to bug 25482
Collapse All | Expand All

(-)a/Koha/REST/V1/AdvancedEditorMacro.pm (-2 lines)
Lines 75-82 sub get { Link Here
75
            error => "This macro is shared, you must access it via advanced_editor/macros/shared"
75
            error => "This macro is shared, you must access it via advanced_editor/macros/shared"
76
        });
76
        });
77
    }
77
    }
78
    warn $macro->borrowernumber;
79
    warn $patron->borrowernumber;
80
    if( $macro->borrowernumber != $patron->borrowernumber ){
78
    if( $macro->borrowernumber != $patron->borrowernumber ){
81
        return $c->render( status => 403, openapi => {
79
        return $c->render( status => 403, openapi => {
82
            error => "You do not have permission to access this macro"
80
            error => "You do not have permission to access this macro"
(-)a/t/db_dependent/api/v1/advanced_editor_macros.t (-2 / +3 lines)
Lines 56-61 subtest 'list() tests' => sub { Link Here
56
            name => 'Test1',
56
            name => 'Test1',
57
            macro => 'delete 100',
57
            macro => 'delete 100',
58
            borrowernumber => $patron_1->borrowernumber,
58
            borrowernumber => $patron_1->borrowernumber,
59
            shared => 0,
59
        }
60
        }
60
    });
61
    });
61
    my $macro_2 = $builder->build_object({ class => 'Koha::AdvancedEditorMacros', value =>
62
    my $macro_2 = $builder->build_object({ class => 'Koha::AdvancedEditorMacros', value =>
Lines 63-69 subtest 'list() tests' => sub { Link Here
63
            name => 'Test2',
64
            name => 'Test2',
64
            macro => 'delete 100',
65
            macro => 'delete 100',
65
            borrowernumber => $patron_1->borrowernumber,
66
            borrowernumber => $patron_1->borrowernumber,
66
            shared=> 1,
67
            shared => 1,
67
        }
68
        }
68
    });
69
    });
69
    my $macro_3 = $builder->build_object({ class => 'Koha::AdvancedEditorMacros', value =>
70
    my $macro_3 = $builder->build_object({ class => 'Koha::AdvancedEditorMacros', value =>
Lines 71-76 subtest 'list() tests' => sub { Link Here
71
            name => 'Test3',
72
            name => 'Test3',
72
            macro => 'delete 100',
73
            macro => 'delete 100',
73
            borrowernumber => $patron_2->borrowernumber,
74
            borrowernumber => $patron_2->borrowernumber,
75
            shared => 0,
74
        }
76
        }
75
    });
77
    });
76
    my $macro_4 = $builder->build_object({ class => 'Koha::AdvancedEditorMacros', value =>
78
    my $macro_4 = $builder->build_object({ class => 'Koha::AdvancedEditorMacros', value =>
77
- 

Return to bug 25482