Created
October 13, 2014 15:02
-
-
Save sanketmaru/d19c237b1d08fd445d09 to your computer and use it in GitHub Desktop.
Permission Check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Permissions.js | |
canAddFields: function(){ | |
var returnVal = this.checkPermissions('isNotExternalUser','hasAddFieldsAccess'); | |
return returnVal; | |
}, | |
checkPermissions : function() { | |
var args = _.toArray(arguments); | |
var returnargs = _(args).every(lang.hitch(this, function(propName) { | |
return this[propName].bind(this).call(); | |
})); | |
return returnargs; | |
}, | |
hasAddFieldsAccess:function(){ | |
return this.hasAccess(addfieldsAccess); | |
}, | |
isNotExternalUser:function(){ | |
// some code to check external user | |
} | |
// We will call from Fields.js | |
Permissions.canAddFields(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment