Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
peternorman #1
Member since Feb 2013 · 19 posts
Group memberships: Members
Show profile · Link to this post
Subject: Modifying an affiliation list
I have created the pubsub node "/home/trinity/cjis" with the admin user.

Here is the affiliation list of that node:

  1. <iq from="pubsub.trinity" to="admin@trinity/MatriX" id="MX_4" type="result" xmlns="jabber:client">
  2.  <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
  3.     <affiliations node="/home/trinity/cjis">
  4.       <affiliation jid="admin@trinity" affiliation="owner" />
  5.     </affiliations>
  6.  </pubsub>
  7. </iq>

I now want user1 to be able to publish to this same node. My understanding is that I need to modify the affiliations of the node itself.

I log in with user1 and then attempt the following:

  1. var a = new Matrix.Xmpp.PubSub.Owner.Affiliation();
  2. a.AffiliationType = AffiliationType.owner;
        
pubSubManager.ModifyAffiliationsList(new Jid("pubsub.trinity"), "/home/trinity/cjis", a, OnIqEventArgs);

Here is the error message I receive:

  1. <iq from="pubsub.trinity" to="user1@trinity/MatriX" type="error" id="MX_4" xmlns="jabber:client">
  2.  <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
  3.     <affiliations node="/home/trinity/cjis">
  4.       <affiliation affiliation="owner" />
  5.     </affiliations>
  6.  </pubsub>
  7.  <error code="400" type="modify">
  8.     <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  9.  </error>
  10. </iq>

I'm assuming I'm sending in the wrong values in the ModifyAffiliationsList method. Any help would be appreciated.

Thank you,
Peter Norman
This post was edited on 2013-03-12, 20:25 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by peternorman:
I log in with user1 and then attempt the following:

of course only the node owner and admins can modify this affiliation list. Otherwise the security model would be totally broken.
So login with admin@trinity and modify it.

Alex
Avatar
peternorman #3
Member since Feb 2013 · 19 posts
Group memberships: Members
Show profile · Link to this post
...

That makes perfect sense :)

Thanks again
Avatar
peternorman #4
Member since Feb 2013 · 19 posts
Group memberships: Members
Show profile · Link to this post
Worked like a charm.

One other question, is there a way of creating a node that all users can publish to by default?
Avatar
Alex #5
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by peternorman:
One other question, is there a way of creating a node that all users can publish to by default?

if your pubsub server supports the Open Publish Model then yes.
This should be the following in the configuration:

  1. <field var='pubsub#publish_model'><value>open</value></field>

Alex
This post was edited on 2013-03-12, 20:53 by Alex.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS