Skip to content

Remote hooks called before ACL rules are applied #1191

Description

@kortac

Right now ACLs are called after before remote hook. That means this stack of calls:

  1. Before remote Hook
  2. ACL
  3. Remote method
  4. After remote hook
    I'd expect ACLs to be checked prior calling before remote hooks and not the other way round.

Example:

Event.beforeRemote("prototype.__unlink__guests", function(ctx, modelInstance, next){
    console.log("before remote hook");
    next();
});

with this ACL

{
  "accessType": "*",
  "principalType": "ROLE",
  "principalId": "$everyone",
  "permission": "DENY",
  "property": "__unlink__guests"
}

Even though the Loopback explorer displays a 401 error, the console displays "before remote hook". In my opinion, this should not be the case.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions