changeset 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
files psgxs.js
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/psgxs.js
+++ b/psgxs.js
@@ -677,8 +677,13 @@ function onIq(stanza) {
 				if (storage.existsNode(nodeID))
 					return makeError(response, errors.nodeid_already_exists.n);
 
-				var affil = storage.getAffiliation(toBareJID(to), nodeID);
-				if (affil != 'super-owner' && affil != 'owner' && affil != 'publish-only')
+				var bare = toBareJID(to);
+				var right = false;
+				for (var i in config.owner)
+					if (config.owner[i] == bare)
+						right = true;
+
+				if (!right)
 					return makeError(response, errors.forbidden.n);
 
 				var configure = pubsub.getChild('configure');