mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Support as read-only HTTP method not only GET, also HEAD
This commit is contained in:
parent
05e3893f60
commit
f59a979f7c
@ -64,11 +64,15 @@ get_acl_rule(["additions.js"],_) -> {"localhost", [all]};
|
||||
get_acl_rule(["vhosts"],_) -> {"localhost", [all]};
|
||||
|
||||
%% The pages of a vhost are only accesible if the user is admin of that vhost:
|
||||
get_acl_rule(["server", VHost | _RPath], 'GET') -> {VHost, [configure, webadmin_view]};
|
||||
get_acl_rule(["server", VHost | _RPath], Method)
|
||||
when Method=:='GET' orelse Method=:='HEAD' ->
|
||||
{VHost, [configure, webadmin_view]};
|
||||
get_acl_rule(["server", VHost | _RPath], 'POST') -> {VHost, [configure]};
|
||||
|
||||
%% Default rule: only global admins can access any other random page
|
||||
get_acl_rule(_RPath, 'GET') -> {global, [configure, webadmin_view]};
|
||||
get_acl_rule(_RPath, Method)
|
||||
when Method=:='GET' orelse Method=:='HEAD' ->
|
||||
{global, [configure, webadmin_view]};
|
||||
get_acl_rule(_RPath, 'POST') -> {global, [configure]}.
|
||||
|
||||
is_acl_match(Host, Rules, Jid) ->
|
||||
|
Loading…
Reference in New Issue
Block a user