summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2009-01-16 16:24:34 +0000
committerMatthias Radestock <matthias@lshift.net>2009-01-16 16:24:34 +0000
commitb11db7b1c427a2196289e2498b28aeac4bd56c9a (patch)
treef9174449faf81e9285c9d5eac99833111d4cccab /include
parentcfe54cf2cbd058a099d8f5d79b3706894df1d6d5 (diff)
downloadrabbitmq-server-b11db7b1c427a2196289e2498b28aeac4bd56c9a.tar.gz
beginnings of permission admin
I changed the table structure (again). It's a choice between two of efficiency, integrity and no data duplication - I picked the last two. We pass the permission regexps around as binaries and store them like that too, just as we do for all other string-y datums. I was toying with the idea of making set_permissions take a #permission record instead of two separate regexp params, so that it is easy to add more permissions later. But that is inconsistent with the rest of the rabbit_access_control API, which is "flat", and complicates the code in rabbit_control and the rabbit_tests.
Diffstat (limited to 'include')
-rw-r--r--include/rabbit.hrl7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/rabbit.hrl b/include/rabbit.hrl
index 02f1ec21..8aba8a6f 100644
--- a/include/rabbit.hrl
+++ b/include/rabbit.hrl
@@ -31,7 +31,8 @@
-record(user, {username, password}).
-record(permission, {configuration, messaging}).
--record(user_permission, {username, virtual_host, permission}).
+-record(user_vhost, {username, virtual_host}).
+-record(user_permission, {user_vhost, permission}).
-record(vhost, {virtual_host, dummy}).
@@ -75,6 +76,7 @@
-type(thunk(T) :: fun(() -> T)).
-type(info_key() :: atom()).
-type(info() :: {info_key(), any()}).
+-type(regexp() :: binary()).
%% this is really an abstract type, but dialyzer does not support them
-type(guid() :: any()).
@@ -89,6 +91,9 @@
-type(user() ::
#user{username :: username(),
password :: password()}).
+-type(permission() ::
+ #permission{configuration :: regexp(),
+ messaging :: regexp()}).
-type(amqqueue() ::
#amqqueue{name :: queue_name(),
durable :: bool(),