Merge pull request 'hotfix accessScopes' (!2458) from hotfix-accesScopesPdf into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2458
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Carlos Satorres 2024-05-15 10:53:15 +00:00
commit 6387075413
9 changed files with 19 additions and 9 deletions

View File

@ -40,7 +40,8 @@ module.exports = Self => {
http: {
path: '/:id/client-debt-statement-pdf',
verb: 'GET'
}
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.clientDebtStatementPdf = (ctx, id) => Self.printReport(ctx, id, 'client-debt-statement');

View File

@ -3,6 +3,7 @@ const UserError = require('vn-loopback/util/user-error');
module.exports = function(Self) {
Self.remoteMethodCtx('createReceipt', {
description: 'Creates receipt and its compensation if necessary',
accessType: 'READ',
accepts: [{
arg: 'clientFk',
type: 'number',
@ -45,7 +46,8 @@ module.exports = function(Self) {
http: {
verb: 'post',
path: '/:clientFk/createReceipt'
}
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.createReceipt = async(ctx, options) => {

View File

@ -35,7 +35,8 @@ module.exports = Self => {
http: {
path: '/:id/credit-request-pdf',
verb: 'GET'
}
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.creditRequestPdf = (ctx, id) => Self.printReport(ctx, id, 'credit-request');

View File

@ -47,7 +47,8 @@ module.exports = Self => {
http: {
path: '/:id/incoterms-authorization-pdf',
verb: 'GET'
}
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.incotermsAuthorizationPdf = (ctx, id) => Self.printReport(ctx, id, 'incoterms-authorization');

View File

@ -41,7 +41,8 @@ module.exports = Self => {
http: {
path: '/:id/letter-debtor-pdf',
verb: 'GET'
}
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.letterDebtorPdf = (ctx, id) => Self.printReport(ctx, id, 'letter-debtor');

View File

@ -29,7 +29,8 @@ module.exports = Self => {
http: {
path: '/:id/balance-compensation-pdf',
verb: 'GET'
}
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.balanceCompensationPdf = (ctx, id) => Self.printReport(ctx, id, 'balance-compensation');

View File

@ -34,7 +34,8 @@ module.exports = Self => {
http: {
path: '/:id/receipt-pdf',
verb: 'GET'
}
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.receiptPdf = (ctx, id) => Self.printReport(ctx, id, 'receipt');

View File

@ -31,7 +31,8 @@ module.exports = Self => {
http: {
path: '/:reference/invoice-out-pdf',
verb: 'GET'
}
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.invoiceOutPdf = async(ctx, reference) => {

View File

@ -51,7 +51,8 @@ module.exports = Self => {
http: {
path: '/:id/label-pdf',
verb: 'GET'
}
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.labelPdf = (ctx, id) => Self.printReport(ctx, id, 'item-label');