You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
565 B
27 lines
565 B
'use strict';
|
|
|
|
const _ = require('lodash');
|
|
const { getService } = require('../utils');
|
|
|
|
module.exports = {
|
|
async getPermissions(ctx) {
|
|
const permissions = await getService('users-permissions').getActions();
|
|
|
|
ctx.send({ permissions });
|
|
},
|
|
|
|
async getPolicies(ctx) {
|
|
const policies = _.keys(strapi.plugin('users-permissions').policies);
|
|
|
|
ctx.send({
|
|
policies: _.without(policies, 'permissions'),
|
|
});
|
|
},
|
|
|
|
async getRoutes(ctx) {
|
|
const routes = await getService('users-permissions').getRoutes();
|
|
|
|
ctx.send({ routes });
|
|
},
|
|
};
|