Skip to content

Instantly share code, notes, and snippets.

View sanketmaru's full-sized avatar
🎧
Code & Music -- Infinite Loop

Sanket Maru sanketmaru

🎧
Code & Music -- Infinite Loop
View GitHub Profile
// test for resolve
it('Should set isValid flag when user is not member of organization', function(done) {
var param = {
username: "sanketteam",
userId: 42808,
switchedOrgId: 7607 //varu@yopmail.com
}
var promise = usermanagement.checkOrganization(param); // returns a promise and uses the service code to return it
// this will be in case of resolve
@sanketmaru
sanketmaru / PermissionCheck
Created October 13, 2014 15:02
Permission Check
// 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();
@sanketmaru
sanketmaru / gist:aa6c32cf7e3653f5d9b6
Created October 10, 2014 14:41
query.atmosphere link
https://github.com/Atmosphere/atmosphere-samples/
@sanketmaru
sanketmaru / sortable
Created October 6, 2014 17:59
Angular sortable links
http://a5hik.github.io/ng-sortable/#/sprint, https://github.com/a5hik/ng-sortable
https://github.com/angular-ui/ui-sortable/blob/master/demo/demo.js
define([],function(){
var messages = {
'login': {
201: 'Email already taken',
400: 'Bad request',
503: 'The server is currently unavailable.'
}
};
return {
getMessage : function(prefix,statusCode) {