on master help sign in
Fixed permission bug
commit99966395535fca251ebee2e11a5ee230d8033f0a authoriko <ilyakooo0@gmail.com> dateSun 5 May 2019, 22:11 (7 years ago) parenta2b4b02
1 file changed+1−1
denis/src/Data/Query.hs+1−1
denis/src/Data/Query.hs+1−1
@@ -636,7 +636,7 @@ updateGroupChat uId (GroupChat gId (Jsonb perms) name) = commitedTransactionally
636636 let userPerm = fromMaybe minChatPermissions $ M.lookup uId perms'
637637 unless (isAdmin userPerm) $
638638 lift $ S.throwError $ S.err401
639− let newPerms = M.adjust (max userPerm) uId perms
639+ let newPerms = M.alter (Just . max userPerm . fromMaybe userPerm) uId perms
640640 void $ manipulateParams updateGroupChatQ (GroupChat gId (Jsonb newPerms) name)
641641
642642leaveGroupChat :: UserId -> GroupChatId -> StaticPQ ()