streamline use if `self`
This commit is contained in:
parent
c538aa764d
commit
ecd881a0f3
|
@ -394,8 +394,9 @@ module.exports = function(ACL) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ACL.checkAccessForContext = function(context, callback) {
|
ACL.checkAccessForContext = function(context, callback) {
|
||||||
this.resolveRelatedModels();
|
var self = this;
|
||||||
var roleModel = this.roleModel;
|
self.resolveRelatedModels();
|
||||||
|
var roleModel = self.roleModel;
|
||||||
|
|
||||||
if (!(context instanceof AccessContext)) {
|
if (!(context instanceof AccessContext)) {
|
||||||
context = new AccessContext(context);
|
context = new AccessContext(context);
|
||||||
|
@ -418,10 +419,9 @@ module.exports = function(ACL) {
|
||||||
var req = new AccessRequest(modelName, property, accessType, ACL.DEFAULT, methodNames);
|
var req = new AccessRequest(modelName, property, accessType, ACL.DEFAULT, methodNames);
|
||||||
|
|
||||||
var effectiveACLs = [];
|
var effectiveACLs = [];
|
||||||
var staticACLs = this.getStaticACLs(model.modelName, property);
|
var staticACLs = self.getStaticACLs(model.modelName, property);
|
||||||
|
|
||||||
var self = this;
|
self.find({where: {model: model.modelName, property: propertyQuery,
|
||||||
this.find({where: {model: model.modelName, property: propertyQuery,
|
|
||||||
accessType: accessTypeQuery}}, function(err, acls) {
|
accessType: accessTypeQuery}}, function(err, acls) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (callback) callback(err);
|
if (callback) callback(err);
|
||||||
|
|
Loading…
Reference in New Issue