Skip to content

Commit 34f00e0

Browse files
committed
Add function head to match single-element list containing for which to search.
1 parent ef7e772 commit 34f00e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

deps/rabbitmq_web_dispatch/src/rabbit_web_dispatch_access_control.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ is_mgmt_user(T) -> intersects(T, [administrator, monitoring, policymaker,
245245
management]).
246246
is_protected_user(T) -> intersects(T, [protected]).
247247

248-
intersects(A, B) -> lists:any(fun(I) -> lists:member(I, B) end, A).
248+
intersects(A, [B]) ->
249+
lists:member(B, A);
250+
intersects(A, B) ->
251+
lists:any(fun(I) -> lists:member(I, B) end, A).
249252

250253
user_matches_vhost(ReqData, User) ->
251254
case vhost(ReqData) of

0 commit comments

Comments
 (0)