Skip to content

Use the new remoting.authorization hook for check access - #1370

Merged
ritch merged 1 commit into
masterfrom
fix/check-access-ordering
May 12, 2015
Merged

ritch merged 1 commit into
masterfrom
fix/check-access-ordering

Conversation

@ritch

@ritch ritch commented May 6, 2015

Copy link
Copy Markdown
Member

/to @raymondfeng
/cc @bajtos @fabien

This PR uses the authorization hook added with this strong-remoting PR.

Connect #1363
Connect #1191

Comment thread lib/application.js

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we save the original authorization implementation and call after loopback auth passed? I think that's the canonical way of overriding methods like this.

var baseAuthorization = remotes.authorization;
remotes.authorization = function(ctx, next) {
  if (authorized) {
    baseAuthorization(ctx, next); // or perhaps .call(this, ctx, next)
  } else {
    next(new Error('Not authorized.'));
  }
};

@bajtos

bajtos commented May 7, 2015

Copy link
Copy Markdown
Member

The CI build is red, please fix it.

@ritch

ritch commented May 7, 2015

Copy link
Copy Markdown
Member Author

The CI build is red, please fix it.

Most likely due to the missing authorization hook (since it is not merged yet).

@ghost ghost assigned raymondfeng May 11, 2015
@ritch ritch mentioned this pull request May 11, 2015
2 tasks done
@ritch

ritch commented May 11, 2015

Copy link
Copy Markdown
Member Author

test please

@ritch
ritch force-pushed the fix/check-access-ordering branch from a8b87c7 to 46cc6b2 Compare May 12, 2015 22:30
@ritch
ritch force-pushed the fix/check-access-ordering branch from 46cc6b2 to 9cde2a4 Compare May 12, 2015 22:33
@raymondfeng

Copy link
Copy Markdown
Member

LGTM.

ritch added a commit that referenced this pull request May 12, 2015
Use the new remoting.authorization hook for check access
@ritch
ritch merged commit 805e0e0 into master May 12, 2015
@altsang altsang removed the #review label May 12, 2015
@bajtos
bajtos deleted the fix/check-access-ordering branch August 6, 2015 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants