comparison psgxs.js @ 2:d3ae2f8b685d

Make create node working.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 28 Jun 2010 22:02:51 +0200
parents c2954a9e5665
children 80e607c0b39e
comparison
equal deleted inserted replaced
1:c2954a9e5665 2:d3ae2f8b685d
675 instant = true; 675 instant = true;
676 } 676 }
677 if (storage.existsNode(nodeID)) 677 if (storage.existsNode(nodeID))
678 return makeError(response, errors.nodeid_already_exists.n); 678 return makeError(response, errors.nodeid_already_exists.n);
679 679
680 var affil = storage.getAffiliation(toBareJID(to), nodeID); 680 var bare = toBareJID(to);
681 if (affil != 'super-owner' && affil != 'owner' && affil != 'publish-only') 681 var right = false;
682 for (var i in config.owner)
683 if (config.owner[i] == bare)
684 right = true;
685
686 if (!right)
682 return makeError(response, errors.forbidden.n); 687 return makeError(response, errors.forbidden.n);
683 688
684 var configure = pubsub.getChild('configure'); 689 var configure = pubsub.getChild('configure');
685 if (configure && config.enabled('create-and-configure')) { 690 if (configure && config.enabled('create-and-configure')) {
686 if (!config.enabled('config-node')) 691 if (!config.enabled('config-node'))