flux-capacitor
Advanced tools
Comparing version 0.1.0 to 0.1.1
// Generated by CoffeeScript 1.3.3 | ||
var _; | ||
_ = require("lodash"); | ||
_.mixin(require("underscore.deferred")); | ||
module.exports = { | ||
_: _, | ||
async: require("async"), | ||
Permissions: require("./permissions"), | ||
@@ -5,0 +12,0 @@ Request: require("./request"), |
@@ -28,3 +28,3 @@ // Generated by CoffeeScript 1.3.3 | ||
} | ||
this.data = this._normalize(data, params); | ||
this.data = params.base ? _.merge({}, this._normalize(params.base, params), this._normalize(data, params)) : this._normalize(data, params); | ||
if (params.inherits) { | ||
@@ -37,3 +37,3 @@ this.setInherits(params.inherits); | ||
Permissions.prototype.extend = function(data, params) { | ||
_.extend(this.data, this._normalize(data)); | ||
_.merge(this.data, this._normalize(data)); | ||
return this; | ||
@@ -40,0 +40,0 @@ }; |
@@ -46,3 +46,3 @@ // Generated by CoffeeScript 1.3.3 | ||
} | ||
this.params = extend ? _.extend(this.params, params) : params; | ||
this.params = extend ? _.merge(this.params, params) : params; | ||
return this; | ||
@@ -49,0 +49,0 @@ }; |
@@ -14,2 +14,6 @@ // Generated by CoffeeScript 1.3.3 | ||
Resource.prototype.baseAllowing = {}; | ||
Resource.prototype.baseAllowed = {}; | ||
function Resource(data) { | ||
@@ -36,2 +40,6 @@ if (data == null) { | ||
Resource.prototype.setAllowed = function(perms, params) { | ||
if (params == null) { | ||
params = {}; | ||
} | ||
params.base = this.baseAllowed; | ||
this.allowed = new Permissions(perms, params); | ||
@@ -42,2 +50,6 @@ return this; | ||
Resource.prototype.setAllowing = function(perms, params) { | ||
if (params == null) { | ||
params = {}; | ||
} | ||
params.base = this.baseAllowing; | ||
this.allowing = new Permissions(perms, params); | ||
@@ -44,0 +56,0 @@ return this; |
// Generated by CoffeeScript 1.3.3 | ||
var Response, Status; | ||
var Response, Status, _; | ||
_ = require("lodash"); | ||
Status = require("./status"); | ||
@@ -9,9 +11,4 @@ | ||
function Response(status, data) { | ||
if (data) { | ||
this.data = data; | ||
this.status = status instanceof Status ? status : new Status(status); | ||
} else { | ||
this.status = new Status(200); | ||
this.data = {}; | ||
} | ||
this.status = status instanceof Status ? status : _.isFinite(status) ? new Status(status) : new Status(200); | ||
this.data = data ? data : _.isObject(status) ? status : null; | ||
} | ||
@@ -28,3 +25,3 @@ | ||
} | ||
_.extend(this.data, data); | ||
_.merge(this.data, data); | ||
return this; | ||
@@ -31,0 +28,0 @@ }; |
{ | ||
"name": "flux-capacitor", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Resource-based access control", | ||
@@ -22,3 +22,3 @@ "main": "lib/flux-capacitor.js", | ||
"coffee-script": "1.3", | ||
"mocha": "1.4", | ||
"mocha": "1", | ||
"should": "1.1", | ||
@@ -25,0 +25,0 @@ "coffeelint": "0.5" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
333814
700