Alexandre Bodin cdc9bc2167 Allow multiple args in policies
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-07-08 11:48:43 +02:00

18 lines
400 B
JavaScript

'use strict';
const { yup, formatYupErrors } = require('strapi-utils');
const hasPermissionsSchema = yup.array().of(yup.string());
const validateHasPermissionsInput = actions => {
try {
return hasPermissionsSchema.validateSync(actions, { strict: true, abortEarly: true });
} catch (e) {
throw new Error(formatYupErrors(e));
}
};
module.exports = {
validateHasPermissionsInput,
};