Skip to content

Commit 08047b3

Browse files
#1 getting the groupAccessModel from configuration
1 parent adcddc9 commit 08047b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/middleware/user-context.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ module.exports = function userContextMiddleware() {
2121
loopbackContext.set('accessToken', req.accessToken.id);
2222
const app = req.app;
2323
const UserModel = app.accessUtils.options.userModel || 'User';
24+
const TeamModel = app.accessUtils.options.groupAccessModel || 'Team';
25+
2426

2527
return Promise.join(
2628
app.models[UserModel].findById(req.accessToken.userId),
27-
app.models.Team.find({
29+
app.models.[TeamModel].find({
2830
where: {
2931
userId: req.accessToken.userId
3032
}

0 commit comments

Comments
 (0)