From 5c9cebf0597749c9c1b869b631cd3a31b18b79d9 Mon Sep 17 00:00:00 2001 From: Nikolay Zlatev Date: Fri, 13 Oct 2023 15:41:17 +0300 Subject: [PATCH] user.Manager: fix ACL write, read order This should fix "read-only access to topic *" being applied before "read-write access to topic _PREFIX_*" Before this if we have: ntfy access user "mytopic*" rw ntfy access user "*" ro read-only access rule was applied first and user couldn't write to mytopic* --- user/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/manager.go b/user/manager.go index 324b7684..bf69d35b 100644 --- a/user/manager.go +++ b/user/manager.go @@ -161,7 +161,7 @@ const ( FROM user_access a JOIN user u ON u.id = a.user_id WHERE (u.user = ? OR u.user = ?) AND ? LIKE a.topic ESCAPE '\' - ORDER BY u.user DESC + ORDER BY u.user DESC, a.write DESC ` insertUserQuery = `