[ejabberd] access_commands in ejabberd.cfg and vhosts (ejabberd2.1)

Pablo Platt pablo.platt at yahoo.com
Sun May 31 15:07:12 MSD 2009


I'm using the trunk version ejabberd2.1

I have two vhosts example1.com and example2.com
I want to configure mod_rest to allow admin1 from example1.com to execute commands only related to host example1.com
and the same for admin2 from example2.com to be able to execute commands only related to host example2.com
The following config works for me. admin1 can execute commands only on example1.com and admin2 can only on example2.com:
{acl, admin1, {user, "admin1", "example1.com"}}.
{access, rest1, [{allow, admin1}]}.
{acl, admin2, {user, "admin2", "example2.com"}}.
{access, rest2, [{allow, admin2}]}.
  {mod_rest, [
        {access_commands, [
            {configure, all, []},
            {rest1, all, [{host, "example1.com"}]},
            {rest2, all, [{host, "example2.com"}]}

Now I'm trying to put vhost related configurations in a separate config file example1.cfg and example2.cfg
I'm including them at the end of my ejabberd.cfg using:
{include_config_file, "/etc/ejabberd/example1.cfg"}.
I removed acl, access and mod_rest configuration related to vhosts and added to example1.cfg, example2.cfg.
Now admin (access rule configure) can execute commands on any vhost but
admin1 from example1.com and admin2 from example2.com can't execute any commands.

  {mod_rest, [
        {access_commands, [
            {configure, all, []}

{host_config, "example1.com",
  {acl, admin1, {user, "admin1", "example1.com"}},
  {access, rest1, [{allow, admin1}]},
  {{add, modules},
    {mod_rest, [ {access_commands,[{rest1, all, [{host, "example1.com"}]}]} ]}

Is it possible to configure access_commands in several places or do I have to set all of them in the main config file?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20090531/37d23a3d/attachment.htm>

More information about the ejabberd mailing list