Skip to content

Commit

Permalink
acl/middleware: support req.user.id for userId
Browse files Browse the repository at this point in the history
  • Loading branch information
nemtsov committed Aug 23, 2015
1 parent 9bc0a24 commit 4b3f44f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/acl.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,8 @@ Acl.prototype.middleware = function(numPathComponents, userId, actions){
if (!userId) {
if((req.session) && (req.session.userId)){
_userId = req.session.userId;
}else if((req.user) && (req.user.id)){
_userId = req.user.id;
}else{
next(new HttpError(401, 'User not authenticated'));
return;
Expand Down

0 comments on commit 4b3f44f

Please sign in to comment.