mirror of
https://github.com/wassname/talk.git
synced 2026-07-05 02:00:39 +08:00
13 lines
345 B
JavaScript
13 lines
345 B
JavaScript
const Action = {
|
|
|
|
// This will load the user for the specific action. We'll limit this to the
|
|
// admin users only or the current logged in user.
|
|
user({user_id}, _, {loaders: {Users}, user}) {
|
|
if (user && (user.hasRole('ADMIN') || user_id === user.id)) {
|
|
return Users.getByID.load(user_id);
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = Action;
|