Socket
Socket
Sign inDemoInstall

endpoints-controller

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

endpoints-controller - npm Package Compare versions

Comparing version 0.2.2 to 0.3.0

14

lib/find_by_id.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc