30 lines
711 B
JavaScript
30 lines
711 B
JavaScript
|
module.exports = Self => {
|
||
|
Self.remoteMethod('userAcl', {
|
||
|
description: 'Get all of the current user permissions',
|
||
|
accepts: [
|
||
|
{
|
||
|
arg: 'ctx',
|
||
|
type: 'Object',
|
||
|
http: {source: 'context'}
|
||
|
}
|
||
|
],
|
||
|
returns: {
|
||
|
type: 'Object',
|
||
|
root: true
|
||
|
},
|
||
|
http: {
|
||
|
path: '/user/acl',
|
||
|
verb: 'GET'
|
||
|
}
|
||
|
});
|
||
|
|
||
|
Self.userAcl = async function(ctx) {
|
||
|
let userId = ctx.req.accessToken.userId;
|
||
|
let models = Self.app.models;
|
||
|
|
||
|
let user = await models.User.findById(userId, {
|
||
|
fields: ['id', 'name', 'nickname']
|
||
|
});
|
||
|
};
|
||
|
};
|