cansecurity
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -57,7 +57,14 @@ /*jslint node:true, nomen:false */ | ||
checkField = function(req,res,next,field,getObject) { | ||
var id = req[csauth][fields.id], i, valid = false, obj = getObject(req,res) || {}; | ||
// check the ID of the user against each field in each result for which it is allowed | ||
for (i=0;i<field.length;i++) { | ||
if (id === obj[field[i]]) { | ||
valid = true; | ||
var id = req[csauth][fields.id], i, j, valid, list = [].concat(getObject(req,res) || {}); | ||
// check the ID of the user against each field in each result for which it is allowed, for each object | ||
// *all* must pass to be allowed | ||
for (j=0;j<list.length;j++) { | ||
valid = false; | ||
for (i=0;i<field.length;i++) { | ||
if (id === list[j][field[i]]) { | ||
valid = true; | ||
break; | ||
} | ||
} | ||
if (!valid) { | ||
break; | ||
@@ -64,0 +71,0 @@ } |
{ | ||
"name": "cansecurity", | ||
"description": "Authentication, authorization, session manager, single-sign-on (SSO) and security framework for node applications", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"url": "http://github.com/deitch/cansecurity", | ||
@@ -6,0 +6,0 @@ "author": "Avi Deitcher <avi@deitcher.net>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70670
1184