hotfix accessScopes #2458

Merged
carlossa merged 1 commits from hotfix-accesScopesPdf into master 2024-05-15 10:53:16 +00:00
9 changed files with 19 additions and 9 deletions

View File

@ -40,7 +40,8 @@ module.exports = Self => {
http: { http: {
path: '/:id/client-debt-statement-pdf', path: '/:id/client-debt-statement-pdf',
verb: 'GET' verb: 'GET'
} },
accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.clientDebtStatementPdf = (ctx, id) => Self.printReport(ctx, id, 'client-debt-statement'); 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) { module.exports = function(Self) {
Self.remoteMethodCtx('createReceipt', { Self.remoteMethodCtx('createReceipt', {
description: 'Creates receipt and its compensation if necessary', description: 'Creates receipt and its compensation if necessary',
accessType: 'READ',
accepts: [{ accepts: [{
arg: 'clientFk', arg: 'clientFk',
type: 'number', type: 'number',
@ -45,7 +46,8 @@ module.exports = function(Self) {
http: { http: {
verb: 'post', verb: 'post',
path: '/:clientFk/createReceipt' path: '/:clientFk/createReceipt'
} },
accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.createReceipt = async(ctx, options) => { Self.createReceipt = async(ctx, options) => {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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