Skip to content

lb3app boot scrip defined role not run when running tests #7098

@bostjanpisler

Description

@bostjanpisler

Steps to reproduce

  • Create boot script: /lb3app/server/boot/role.js
module.exports = async function(app) {
  var Role = app.models.Role;

  Role.registerResolver('testrole', function(role, ctx, cb) {
    console.log('testrole');

    process.nextTick(function() {
      cb(null, true);
    });
  });
};

Add it to a model json "acls" definition:

    {
      "accessType": "EXECUTE",
      "principalType": "ROLE",
      "principalId": "$unauthenticated",
      "permission": "DENY",
      "property": "create"
    },
    {
      "accessType": "EXECUTE",
      "principalType": "ROLE",
      "principalId": "testrole",
      "permission": "ALLOW",
      "property": "create"
    }

Current Behavior

Running a test to create a resource on the model returns 401 error.

Expected Behavior

Running a test to create a resource on the model should be successful with 200 status.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions