endpoints-controller
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -8,15 +8,8 @@ var Promise = require('when'); | ||
var account = req.account; | ||
var id = parseInt(req.params.id); | ||
var id = req.params.id; | ||
var preflight; | ||
// bail on non numeric ids or models that require security | ||
// when there is no account logged in | ||
if(isNaN(id)) { | ||
// bail on models that require security when there is no account logged in | ||
if (Model.allowedFor && !account) { | ||
res.data = { errors : [ | ||
{ message: "Non numeric id", status : "Not Acceptable" } | ||
]}; | ||
res.code = 406; | ||
next(); | ||
} else if (Model.allowedFor && !account) { | ||
res.data = { errors : [ | ||
{ message : "Not authorized", status: "Unauthorized" } | ||
@@ -28,3 +21,2 @@ ]}; | ||
// if model has an allowedFor method and the current account | ||
@@ -31,0 +23,0 @@ // is not an administrator, validate that we can view it |
{ | ||
"name": "endpoints-controller", | ||
"description": "controller layer for the endpoints framework.", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"homepage": "https://github.com/endpoints/controller", | ||
@@ -6,0 +6,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
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
9189
224