Show current user name, locale and tenant (if available). Useful in deployments w/ real auth and tenant contexts.
12 lines
221 B
JavaScript
12 lines
221 B
JavaScript
const cds = require('@sap/cds');
|
|
|
|
module.exports = cds.service.impl((srv) => {
|
|
srv.on('READ', 'Me', ({ user }) => {
|
|
return {
|
|
ID: user.id,
|
|
locale: user.locale,
|
|
tenant: user.tenant,
|
|
};
|
|
});
|
|
});
|