@@ -, +, @@ settings --- Koha/REST/V1/Preservation.pm | 4 ++ .../definitions/preservation_config.yaml | 3 ++ .../vue/components/Preservation/Settings.vue | 46 ++++++++++++++++++- 3 files changed, 51 insertions(+), 2 deletions(-) --- a/Koha/REST/V1/Preservation.pm +++ a/Koha/REST/V1/Preservation.pm @@ -39,6 +39,7 @@ Return the configuration options needed for the Preservation Vue app sub config { my $c = shift->openapi->valid_input or return; + my $patron = $c->stash('koha.user'); return $c->render( status => 200, openapi => { @@ -47,6 +48,9 @@ sub config { not_for_loan_waiting_list_in => C4::Context->preference('PreservationNotForLoanWaitingListIn'), not_for_loan_default_train_in => C4::Context->preference('PreservationNotForLoanDefaultTrainIn'), }, + permissions => { + 'manage_sysprefs' => $patron->has_permission( { parameters => 'manage_sysprefs' } ) ? 1 : 0, + }, }, ); } --- a/api/v1/swagger/definitions/preservation_config.yaml +++ a/api/v1/swagger/definitions/preservation_config.yaml @@ -4,4 +4,7 @@ properties: settings: type: object description: List of sysprefs used for the Preservation module + permissions: + type: object + description: List of permissions of the logged in user used for the Preservation module additionalProperties: false --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Settings.vue +++ a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/Settings.vue @@ -5,7 +5,10 @@ {{ $__("Edit preservation settings") }}