diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2010-11-11 16:29:10 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-11-11 16:29:10 +0000 |
commit | 3c3171c081e558dfe6d497e2f7d8ae1c5e07e408 (patch) | |
tree | 9f605a25748755e512a0020484441125accfa04c /src/rabbit_upgrade_functions.erl | |
parent | 01025113c659b03a2dbb8c28cf25df76a5f1fa8d (diff) | |
parent | 19ed18c2d1d34d8476ed96581915730b1870e492 (diff) | |
download | rabbitmq-server-3c3171c081e558dfe6d497e2f7d8ae1c5e07e408.tar.gz |
Merging bug 22573 to default
Diffstat (limited to 'src/rabbit_upgrade_functions.erl')
-rw-r--r-- | src/rabbit_upgrade_functions.erl | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/rabbit_upgrade_functions.erl b/src/rabbit_upgrade_functions.erl new file mode 100644 index 00000000..59b8705d --- /dev/null +++ b/src/rabbit_upgrade_functions.erl @@ -0,0 +1,51 @@ +%% The contents of this file are subject to the Mozilla Public License +%% Version 1.1 (the "License"); you may not use this file except in +%% compliance with the License. You may obtain a copy of the License at +%% http://www.mozilla.org/MPL/ +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +%% License for the specific language governing rights and limitations +%% under the License. +%% +%% The Original Code is RabbitMQ. +%% +%% The Initial Developers of the Original Code are Rabbit Technologies Ltd. +%% +%% Copyright (C) 2010 Rabbit Technologies Ltd. +%% +%% All Rights Reserved. +%% +%% Contributor(s): ______________________________________. +%% +-module(rabbit_upgrade_functions). + +-include("rabbit.hrl"). + +-compile([export_all]). + +-rabbit_upgrade({remove_user_scope, []}). + +%% ------------------------------------------------------------------- + +-ifdef(use_specs). + +-spec(remove_user_scope/0 :: () -> 'ok'). + +-endif. + +%%-------------------------------------------------------------------- + +remove_user_scope() -> + {atomic, ok} = mnesia:transform_table( + rabbit_user_permission, + fun (Perm = #user_permission{ + permission = {permission, + _Scope, Conf, Write, Read}}) -> + Perm#user_permission{ + permission = #permission{configure = Conf, + write = Write, + read = Read}} + end, + record_info(fields, user_permission)), + ok. |