summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2010-07-14 15:35:07 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2010-07-14 15:35:07 +0100
commit2869d77ab9bbaceaf55234a140f9b1f83f663e67 (patch)
treefddc62157fa4223c912419266074f2dda2760ad4
parent230b712847a1dd8ab1c497bee381da701f997166 (diff)
parent78ecc347eef876669d6e848de787eaf345dd2bcd (diff)
downloadrabbitmq-server-git-2869d77ab9bbaceaf55234a140f9b1f83f663e67.tar.gz
merge bug22875 into bug22964
-rw-r--r--docs/rabbitmqctl.1.xml10
-rw-r--r--src/rabbit_access_control.erl6
2 files changed, 11 insertions, 5 deletions
diff --git a/docs/rabbitmqctl.1.xml b/docs/rabbitmqctl.1.xml
index 836af26432..3327a31d56 100644
--- a/docs/rabbitmqctl.1.xml
+++ b/docs/rabbitmqctl.1.xml
@@ -633,10 +633,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 5578e24bcc..5eb80325db 100644
--- a/src/rabbit_access_control.erl
+++ b/src/rabbit_access_control.erl
@@ -176,9 +176,13 @@ check_resource_access(Username,
[] ->
false;
[#user_permission{permission = P}] ->
+ PermRegexp = case element(permission_index(Permission), P) of
+ <<"">> -> <<$^, $$>>; % <<"^$">> breaks 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