The communications platform that puts data protection first.
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.
Rocket.Chat/packages/rocketchat-api/server/v1/misc.js

34 lines
639 B

RocketChat.API.v1.addRoute('info', { authRequired: false }, {
get: function() {
9 years ago
const user = this.getLoggedInUser();
if (user && RocketChat.authz.hasRole(user._id, 'admin')) {
return RocketChat.API.v1.success({
info: RocketChat.Info
});
}
return RocketChat.API.v1.success({
info: {
'version': RocketChat.Info.version
}
});
}
});
RocketChat.API.v1.addRoute('me', { authRequired: true }, {
get: function() {
return RocketChat.API.v1.success(_.pick(this.user, [
'_id',
'name',
'emails',
'status',
'statusConnection',
'username',
'utcOffset',
'active',
'language'
]));
}
});