From eb02ac1ef5439b64d255a97d43df31b1fe2bdc3b Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Fri, 25 Oct 2019 17:27:38 +0530 Subject: [PATCH] FIX: always include admins in 'assign' allowed users list. --- plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index f7196a3..cc59d97 100644 --- a/plugin.rb +++ b/plugin.rb @@ -69,7 +69,7 @@ after_initialize do add_class_method(:user, :assign_allowed) do allowed_groups = SiteSetting.assign_allowed_on_groups.split('|') - where("users.id IN ( + where("users.admin OR users.id IN ( SELECT user_id FROM group_users INNER JOIN groups ON group_users.group_id = groups.id WHERE groups.#{attribute} IN (?)