2017-11-06 11:14:43 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* UsersPermissions.js controller
|
|
|
|
*
|
|
|
|
* @description: A set of functions called "actions" of the `users-permissions` plugin.
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Default action.
|
|
|
|
*
|
|
|
|
* @return {Object}
|
|
|
|
*/
|
2017-11-15 14:00:51 +01:00
|
|
|
getRole: async(ctx) => {
|
|
|
|
const { id } = ctx.params;
|
|
|
|
|
|
|
|
ctx.send({ ok: true });
|
|
|
|
},
|
2017-11-06 11:14:43 +01:00
|
|
|
|
|
|
|
index: async (ctx) => {
|
|
|
|
// Add your own logic here.
|
|
|
|
|
|
|
|
// Send 200 `ok`
|
|
|
|
ctx.send({
|
|
|
|
message: 'ok'
|
|
|
|
});
|
2017-11-14 17:09:13 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
init: async (ctx) => {
|
|
|
|
// Will be deleted
|
|
|
|
ctx.send({ hasAdmin: ctx.params.hasAdmin === 'true' });
|
2017-11-06 11:14:43 +01:00
|
|
|
}
|
|
|
|
};
|