ejabberd - Comments for "mod_muc acl based room access" https://www.ejabberd.im/node/5521 en So our internal dev team was https://www.ejabberd.im/node/5521#comment-58764 <p>So our internal dev team was able to figure it out, we had to write a small mod to mod_muc</p> <p>file: moc_muc_room.erl<br /> line start: 1296</p> <div class="codeblock"><code>get_affiliation(JID, StateData) -&gt;<br />&nbsp;&nbsp;&nbsp; {_AccessRoute, _AccessCreate, AccessAdmin, _AccessPersistent} = StateData#state.access,<br />&nbsp;&nbsp;&nbsp; Res =<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case acl:match_rule(StateData#state.server_host, AccessAdmin, JID) of<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allow -&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; owner;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ -&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACLNAME = list_to_atom(StateData#state.room),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case acl:match_rule(StateData#state.server_host, ACLNAME, JID) of<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; moderate -&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; owner;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ -&gt;<br /> case acl:match_rule(StateData#state.server_host, ACLNAME, JID) of<br /> join -&gt;<br /> member;<br /> _ -&gt;<br /> LJID = jlib:jid_tolower(JID),<br /> case ?DICT:find(LJID, StateData#state.affiliations) of<br /> {ok, Affiliation} -&gt;<br /> Affiliation;<br /> _ -&gt;<br /> LJID1 = jlib:jid_remove_resource(LJID),<br /> case ?DICT:find(LJID1, StateData#state.affiliations) of<br /> {ok, Affiliation} -&gt;<br /> Affiliation;<br /> _ -&gt;<br /> LJID2 = setelement(1, LJID, &quot;&quot;),<br /> case ?DICT:find(LJID2, StateData#state.affiliations) of<br /> {ok, Affiliation} -&gt;<br /> Affiliation;<br /> _ -&gt;<br /> LJID3 = jlib:jid_remove_resource(LJID2),<br /> case ?DICT:find(LJID3, StateData#state.affiliations) of<br /> {ok, Affiliation} -&gt;<br /> Affiliation;<br /> _ -&gt;<br /> none<br /> end<br /> end<br /> end<br /> end<br /> end<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end,<br />&nbsp;&nbsp;&nbsp; case Res of<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {A, _Reason} -&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ -&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Res<br />&nbsp;&nbsp;&nbsp; end.</code></div> <p>In laymens terms it looks for a Access Rule that matches the muc channel name. Then cross matches the join/moderate flags to set member/owner status based on ACL's</p> Wed, 30 May 2012 15:00:41 +0000 themanwithanrx7 comment 58764 at https://www.ejabberd.im mikekaganski https://www.ejabberd.im/node/5521#comment-58763 <div class="quote-msg"> <div class="quote-author"><em>mikekaganski</em> wrote:</div> <div class="quote-msg"> <div class="quote-author"><em>themanwithanrx7</em> wrote:</div> <p>{hosts, ["jabber.eve-razor.com"]}.</p></div> <div class="quote-msg"> <div class="quote-author"><em>http://www.eve-razor.com/forum/</em> wrote:</div> <p>An Error Has Occurred!</p> <p> Sorry Guest, you are banned from using this forum!<br /> Your coming from russia, so your prob a spy. If your not a spy (lol) have your corp ceo contact mrrx7</p></div> <p>I would never help such xenophobic organization.<br /> By the way, does your country (Germany?) start with lowercase, too?</p></div> <p>That's not meant in a xenophobic nature, it's for a gaming community where Russian speaking clans try to spy on others. Look up eve-online and you'll maybe understand :) Your comment about spelling and grammar is de minimis.</p> Wed, 30 May 2012 14:49:34 +0000 willmorgan comment 58763 at https://www.ejabberd.im themanwithanrx7 https://www.ejabberd.im/node/5521#comment-58755 <div class="quote-msg"> <div class="quote-author"><em>themanwithanrx7</em> wrote:</div> <p>{hosts, ["jabber.eve-razor.com"]}.</p></div> <div class="quote-msg"> <div class="quote-author"><em>http://www.eve-razor.com/forum/</em> wrote:</div> <p>An Error Has Occurred!</p> <p> Sorry Guest, you are banned from using this forum!<br /> Your coming from russia, so your prob a spy. If your not a spy (lol) have your corp ceo contact mrrx7</p></div> <p>I would never help such xenophobic organization.<br /> By the way, does your country (Germany?) start with lowercase, too?</p> Wed, 30 May 2012 05:11:42 +0000 mikekaganski comment 58755 at https://www.ejabberd.im