Skip to content
This repository was archived by the owner on Jul 30, 2022. It is now read-only.
This repository was archived by the owner on Jul 30, 2022. It is now read-only.

Sails.js policy handling? #1

@romandecker

Description

@romandecker

Hello,

I've found that sails-policies aren't called when using swagger-sails.

Minimum example to reproduce:

swagger project create hello-world

Change line in config/policies.js from

// '*': true,

to

'*': "testpolicy"

This will actually break startup, because now sails is looking for a policy that does not yet exist. Now, create the file api/policies/testpolicy.js:

module.exports = function( req, res, next ) {
    sails.log( "IN TEST POLICY" );    
};

The application will now start up again:

swagger project start

But the policy is not called when accessing the default controller via "localhost:10010/hello"! Is this the expected behaviour? Is there another way of implementing policy-like semantics with swagger-node?

Metadata

Metadata

Assignees

No one assigned

    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