Skip to content

Add "authorize" hook #1363

Closed
Closed

Description

@ritch

In order to fix #1191 we need support for a special hook that is executed as the first "before" hook. Something like this should work:

remotes.authorize = function(ctx, next) {
   // called first, preceding any other before hook
   next();
}

checkAccess() would be called using this hook ensuring ACLs are checked before any other hooks.

/cc @fabien @bajtos @raymondfeng

Tasks

  • create PR adding authorization hook to strong-remoting
  • create PR using the new authorization hook in enableAuth() instead of beforeRemote

Activity

  1. self-assigned this
    on May 5, 2015
  2. changed the title [-]Extend before hooks to support "last before hook"[/-] [+]Extend before hooks to support "initial before hook"[/+] on May 5, 2015
  3. seriousben commented on May 5, 2015

    @seriousben
    Contributor

    Really last, not as the first remote hook?

    Except if you want to move all current beforeRemote to be called within the remotes.initialBeforeHook.

  4. ritch commented on May 5, 2015

    @ritch
    MemberAuthor

    Really last, not as the first remote hook?

    edited :)

  5. seriousben commented on May 5, 2015

    @seriousben
    Contributor

    :)

  6. ghost removed on May 6, 2015
  7. ghost added on May 6, 2015
  8. ghost removed on May 6, 2015
  9. ghost changed the title [-]Extend before hooks to support "initial before hook"[/-] [+]70 Extend before hooks to support "initial before hook"[/+] on May 6, 2015
  10. ghost changed the title [-]70 Extend before hooks to support "initial before hook"[/-] [+]A Extend before hooks to support "initial before hook"[/+] on May 6, 2015
  11. ghost changed the title [-]A Extend before hooks to support "initial before hook"[/-] [+]70 Extend before hooks to support "initial before hook"[/+] on May 6, 2015
  12. bajtos commented on May 6, 2015

    @bajtos
    Member

    As long as there is only one hook of this type, then it makes sense. Can we please use a different method name please, to make it more obvious what is the purpose of this hook? For example:

    remotes.authorize = function(ctx, next) { next(); };
  13. ritch commented on May 6, 2015

    @ritch
    MemberAuthor

    authorize sounds good to me.

  14. changed the title [-]70 Extend before hooks to support "initial before hook"[/-] [+]70 Extend before hooks to support "authorize" hook[/+] on May 6, 2015
  15. changed the title [-]70 Extend before hooks to support "authorize" hook[/-] [+]70 Add "authorize" hook[/+] on May 6, 2015
  16. ghost changed the title [-]70 Add "authorize" hook[/-] [+]Add "authorize" hook[/+] on May 6, 2015
  17. ritch commented on May 12, 2015

    @ritch
    MemberAuthor

    Released as v2.17.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions