diff options
author | Emile Joubert <emile@rabbitmq.com> | 2010-07-14 16:56:52 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2010-07-14 16:56:52 +0100 |
commit | 77d9f83cc2e8e6afea0a42d0953d3adfaf2769e1 (patch) | |
tree | bea25eb3042c6361cff0f39642efab5663a03357 | |
parent | a6c0f6d8a917ab176a08b392a4bfea46a09713b3 (diff) | |
parent | c0e1d418e5f4c9846e11d53268238ec5c6db544f (diff) | |
download | rabbitmq-server-77d9f83cc2e8e6afea0a42d0953d3adfaf2769e1.tar.gz |
Merged heads
-rw-r--r-- | docs/rabbitmqctl.1.xml | 10 | ||||
-rw-r--r-- | src/rabbit_access_control.erl | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/docs/rabbitmqctl.1.xml b/docs/rabbitmqctl.1.xml index 26863ae7..e53a97c2 100644 --- a/docs/rabbitmqctl.1.xml +++ b/docs/rabbitmqctl.1.xml @@ -627,10 +627,12 @@ <para role="example-prefix">For example:</para> <screen role="example">rabbitmqctl list_permissions -p /myvhost</screen> <para role="example"> - This command instructs the RabbitMQ broker to list all the - users which have been granted access to the virtual host - called <command>/myvhost</command>, and the permissions they - have for operations on resources in that virtual host. + This command instructs the RabbitMQ broker to list all + the users which have been granted access to the virtual + host called <command>/myvhost</command>, and the + permissions they have for operations on resources in + that virtual host. Note that an empty string means no + permissions granted. </para> </listitem> </varlistentry> diff --git a/src/rabbit_access_control.erl b/src/rabbit_access_control.erl index 7d1839bb..30bae25e 100644 --- a/src/rabbit_access_control.erl +++ b/src/rabbit_access_control.erl @@ -172,9 +172,14 @@ check_resource_access(Username, [] -> false; [#user_permission{permission = P}] -> + PermRegexp = case element(permission_index(Permission), P) of + %% <<"^$">> breaks Emacs' erlang mode + <<"">> -> <<$^, $$>>; + RE -> RE + end, case regexp:match( binary_to_list(Name), - binary_to_list(element(permission_index(Permission), P))) of + binary_to_list(PermRegexp)) of {match, _, _} -> true; nomatch -> false end |