mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Allow clearing all ACL and access rules
This commit is contained in:
parent
d45ad3e3a5
commit
47039aed15
11
src/acl.erl
11
src/acl.erl
@ -34,7 +34,7 @@
|
||||
match_rule/3, match_acl/3, transform_options/1,
|
||||
opt_type/1]).
|
||||
|
||||
-export([add_access/3]).
|
||||
-export([add_access/3, clear/0]).
|
||||
|
||||
-include("ejabberd.hrl").
|
||||
-include("logger.hrl").
|
||||
@ -45,6 +45,7 @@
|
||||
rules = [] :: [access_rule()]}).
|
||||
|
||||
-type regexp() :: binary().
|
||||
-type iprange() :: {inet:ip_address(), integer()} | binary().
|
||||
-type glob() :: binary().
|
||||
-type access_name() :: atom().
|
||||
-type access_rule() :: {atom(), any()}.
|
||||
@ -63,7 +64,7 @@
|
||||
{user_glob, {glob(), host()} | glob()} |
|
||||
{server_glob, glob()} |
|
||||
{resource_glob, glob()} |
|
||||
{ip, {inet:ip_address(), integer()}} |
|
||||
{ip, iprange()} |
|
||||
{node_glob, {glob(), glob()}}.
|
||||
|
||||
-type acl() :: #acl{aclname :: aclname(),
|
||||
@ -206,6 +207,12 @@ load_from_config() ->
|
||||
end, AccessRules)
|
||||
end, Hosts).
|
||||
|
||||
%% Delete all previous set ACLs and Access rules
|
||||
clear() ->
|
||||
mnesia:clear_table(acl),
|
||||
mnesia:clear_table(access),
|
||||
ok.
|
||||
|
||||
b(S) ->
|
||||
iolist_to_binary(S).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user