mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 03:13:58 +08:00
15 lines
287 B
JavaScript
15 lines
287 B
JavaScript
const { VIEW_USER_STATUS } = require('../../perms/constants');
|
|
|
|
const UserState = {
|
|
status: (user, args, ctx) => {
|
|
if (
|
|
ctx.user &&
|
|
(ctx.user.id === user.id || ctx.user.can(VIEW_USER_STATUS))
|
|
) {
|
|
return user.status;
|
|
}
|
|
},
|
|
};
|
|
|
|
module.exports = UserState;
|