strapi-plugin-content-manager
Version:
A powerful UI to easily manage your data.
20 lines (14 loc) • 328 B
JavaScript
const {
contentTypes: { hasDraftAndPublish },
} = require('strapi-utils');
module.exports = (ctx, next) => {
const {
params: { model: modelUid },
} = ctx;
const model = strapi.contentTypes[modelUid];
if (!hasDraftAndPublish(model)) {
throw strapi.errors.forbidden();
}
return next();
};
;