caradoc-security

security middleware for caradoc framework

npm install caradoc-security
8 downloads in the last week
16 downloads in the last month

security middleware for caradoc bundle

Install

$ sudo npm -g install caradoc $ caradoc create:project projectName $ cd projectName && npm install

then complete the /config/security.js file

‘‘‘js

active : 'false/true' // determine if active or not

firewalls : {
    nameOfTheFirewall :{
        pattern : '/someroute', // setup the route under which firewall is active
        anonymous : 'true/false', // deternime if you can access the content without being connected
        role : [ ROLE_MEMBER, ROLE_ADMIN], // role needed to access this content the role should be store in req.user.role
        exclude : [ '/aRoute', '/anOtherRoute'] // route exclude from the firewall
    }
},
security : {

    // just set the route to the different page
    // use for user middleware

},

user : {

    // specify the route to your user, use for user middleware
}
npm loves you