ee-soa-service
Advanced tools
Comparing version 0.2.29 to 0.2.30
@@ -25,16 +25,4 @@ | ||
, _permissionMap: { | ||
list: 'read' | ||
, listOne: 'read' | ||
, create: 'create' | ||
, createOrUpdate: 'create' | ||
, update: 'update' | ||
, updateRelation: 'update' | ||
, delete: 'delete' | ||
, deleteRelation: 'delete' | ||
, describe: 'describe' | ||
} | ||
, init: function(options, dirname) { | ||
@@ -227,3 +215,3 @@ this.options = options || {}; | ||
// check permissions, go through or return an error | ||
if (permission.isActionAllowed(this.name+'.'+collection, this._permissionMap[action] || action)) { | ||
if (permission.isActionAllowed(this.name+'.'+collection, action)) { | ||
@@ -241,3 +229,3 @@ if (debugService) log.info('[DefaultService] '+[this.name, req.getCollection(), req.getActionName()].join('.')+' - access was granted!'); | ||
callback(new Error('You [the user(s) '+permission.getUsers().map(function(u) {return u.id}).join(', ')+' and the service(s) '+permission.getServices().map(function(s) {return s.identifier}).join(', ')+'] are not allowed to access the controller «'+collection+'», action «'+(this._permissionMap[action] || action)+'» on the service «'+this.name+'»!'), {}, SOAResponse.statusCodes.ACCESS_UNAUTHORIZED); | ||
callback(new Error('You [the user(s) '+permission.getUsers().map(function(u) {return u.id}).join(', ')+' and the service(s) '+permission.getServices().map(function(s) {return s.identifier}).join(', ')+'] are not allowed to access the controller «'+collection+'», action «'+(action)+'» on the service «'+this.name+'»!'), {}, SOAResponse.statusCodes.ACCESS_UNAUTHORIZED); | ||
} | ||
@@ -248,3 +236,3 @@ }.bind(this)).catch(function(err) { | ||
// failed to load the permissions | ||
callback(new Error('Failed to load the permissions for the controller «'+collection+'», action «'+(this._permissionMap[action] || action)+'» on the service «'+this.name+'»: '+err), {}, SOAResponse.statusCodes.SERVICE_EXCEPTION); | ||
callback(new Error('Failed to load the permissions for the controller «'+collection+'», action «'+(action)+'» on the service «'+this.name+'»: '+err), {}, SOAResponse.statusCodes.SERVICE_EXCEPTION); | ||
}.bind(this)); | ||
@@ -251,0 +239,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
, "keywords" : ["ee", "soa", "service"] | ||
, "version" : "0.2.29" | ||
, "version" : "0.2.30" | ||
, "author": { | ||
@@ -8,0 +8,0 @@ "name" : "Tobias Kneubuehler" |
80309
1347