diff --git a/core/server/models/user.js b/core/server/models/user.js index cc5ddc308b..57b6434690 100644 --- a/core/server/models/user.js +++ b/core/server/models/user.js @@ -284,7 +284,7 @@ User = ghostBookshelf.Model.extend({ query = this.forge(data, {include: options.include}); - query.query('join', 'roles_users', 'users.id', '=', 'roles_users.id'); + query.query('join', 'roles_users', 'users.id', '=', 'roles_users.user_id'); query.query('join', 'roles', 'roles_users.role_id', '=', 'roles.id'); query.query('where', 'roles.name', '=', lookupRole); } else {