diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2010-07-14 15:53:49 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2010-07-14 15:53:49 +0100 |
| commit | b5c07d02bbafcbc011ef803d0979b95c3ac9b931 (patch) | |
| tree | b2d320616e1f603d987029f63a2e1e5aadd3eeba | |
| parent | 3c753971c2272be4ee93318c003f75133db19535 (diff) | |
| parent | 10cf7fbbcee3ef89b27a4228563c6dad01a4f247 (diff) | |
| download | rabbitmq-server-git-b5c07d02bbafcbc011ef803d0979b95c3ac9b931.tar.gz | |
Merge bug22875 into default
| -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 26863ae78a..e53a97c2c9 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 7d1839bb6e..30bae25e5a 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 |
