lib/routing.js
function getPolicies(controller, action) {
		var policies = config.policies;
		var currentPolicies = [];
		if (policies[controller] && policies[controller][action]) {
			currentPolicies = policies[controller][action];
		} else if (Object.isString(policies[controller])) {
			currentPolicies = policies[controller];
		} else if (policies[controller] && policies[controller]['*']) {
			currentPolicies = policies[controller]['*'];
		} else if (policies['*']) {
			currentPolicies = policies['*'];
		}

		if (currentPolicies === true) {
			currentPolicies = [];
		}

		if (!Object.isArray(currentPolicies)) {
			currentPolicies = [currentPolicies];
		}

		currentPolicies = currentPolicies.map(function(policy) {
			var policyPath = path.join(config.rootDir, config.paths.policies, policy);
			return require(policyPath);
		});
		return currentPolicies;
	}
function getPolicies(controller, action) {
		var policies = config.policies;
		var currentPolicies = [];
		if (policies[controller] && policies[controller][action]) {
			currentPolicies = policies[controller][action];
		} else if (Object.isString(policies[controller])) {
			currentPolicies = policies[controller];
		} else if (policies[controller] && policies[controller]['*']) {
			currentPolicies = policies[controller]['*'];
		} else if (policies['*']) {
			currentPolicies = policies['*'];
		}

		if (currentPolicies === true) {
			currentPolicies = [];
		}

		if (!Object.isArray(currentPolicies)) {
			currentPolicies = [currentPolicies];
		}

		currentPolicies = currentPolicies.map(function(policy) {
			var policyPath = path.join(config.rootDir, config.paths.policies, policy);
			return require(policyPath);
		});
		return currentPolicies;
	}
function getPolicies ( controller , action ) { var policies = config . policies ; var currentPolicies = [ ] ; if ( policies [ controller ] && policies [ controller ] [ action ] ) { currentPolicies = policies [ controller ] [ action ] ; } else if ( Object . isString ( policies [ controller ] ) ) { currentPolicies = policies [ controller ] ; } else if ( policies [ controller ] && policies [ controller ] [ '*' ] ) { currentPolicies = policies [ controller ] [ '*' ] ; } else if ( policies [ '*' ] ) { currentPolicies = policies [ '*' ] ; } if ( currentPolicies === true ) { currentPolicies = [ ] ; } if ( ! Object . isArray ( currentPolicies ) ) { currentPolicies = [ currentPolicies ] ; } currentPolicies = currentPolicies . map ( function ( policy ) { var policyPath = path . join ( config . rootDir , config . paths . policies , policy ) ; return require ( policyPath ) ; } ) ; return currentPolicies ; }
gets the policies in effect for a given controller and action
@param  {String} controller
@param  {String} action
@return {Array}            policies
gets the policies in effect for a given controller and action