lib/accessing.js
function AccessRequest(model, property, accessType, permission, methodNames) {
    if (!(this instanceof AccessRequest)) {
        return new AccessRequest(model, property, accessType, permission, methodNames);
    }
    if (arguments.length === 1 && typeof model === 'object') {
        // The argument is an object that contains all required properties
        var obj = model || {};
        this.model = obj.model || AccessContext.ALL;
        this.property = obj.property || AccessContext.ALL;
        this.accessType = obj.accessType || AccessContext.ALL;
        this.permission = obj.permission || AccessContext.DEFAULT;
        this.methodNames = methodNames || [];
    } else {
        this.model = model || AccessContext.ALL;
        this.property = property || AccessContext.ALL;
        this.accessType = accessType || AccessContext.ALL;
        this.permission = permission || AccessContext.DEFAULT;
        this.methodNames = methodNames || [];
    }
}
function AccessRequest(model, property, accessType, permission, methodNames) {
    if (!(this instanceof AccessRequest)) {
        return new AccessRequest(model, property, accessType, permission, methodNames);
    }
    if (arguments.length === 1 && typeof model === 'object') {
        // The argument is an object that contains all required properties
        var obj = model || {};
        this.model = obj.model || AccessContext.ALL;
        this.property = obj.property || AccessContext.ALL;
        this.accessType = obj.accessType || AccessContext.ALL;
        this.permission = obj.permission || AccessContext.DEFAULT;
        this.methodNames = methodNames || [];
    } else {
        this.model = model || AccessContext.ALL;
        this.property = property || AccessContext.ALL;
        this.accessType = accessType || AccessContext.ALL;
        this.permission = permission || AccessContext.DEFAULT;
        this.methodNames = methodNames || [];
    }
}
function AccessRequest ( model , property , accessType , permission , methodNames ) { if ( ! ( this instanceof AccessRequest ) ) { return new AccessRequest ( model , property , accessType , permission , methodNames ) ; } if ( arguments . length === 1 && typeof model === 'object' ) { // The argument is an object that contains all required properties var obj = model || { } ; this . model = obj . model || AccessContext . ALL ; this . property = obj . property || AccessContext . ALL ; this . accessType = obj . accessType || AccessContext . ALL ; this . permission = obj . permission || AccessContext . DEFAULT ; this . methodNames = methodNames || [ ] ; } else { this . model = model || AccessContext . ALL ; this . property = property || AccessContext . ALL ; this . accessType = accessType || AccessContext . ALL ; this . permission = permission || AccessContext . DEFAULT ; this . methodNames = methodNames || [ ] ; } }
A request to access protected resources.
@param {String} model The model name
@param {String} property
@param {String} accessType The access type
@param {String} permission The requested permission
@param {String} methodNames The method names
@returns {AccessRequest}
@class
A request to access protected resources .