Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-67596

[CQF] findAndModify/update with $where clause fails with authorization error

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • QO 2022-10-03

      This bug is specific to the new optimizer Bonsai. For a test like this one, the server asserts with the following errmsg:

      "Authorization Session contains more authorization checks then permitted by contract.",
      

      After a brief investigation, the callstack looks like we're building the WhereMatchExpression which holds a JsFunction. The JsFunction loads the stored functions which reads from the system.js collection (find command) and eventually causes the assertion. It could be that the existing translation through aggregate is causing issues with auth and translating directly from the find command would fix this.

            Assignee:
            hana.pearlman@mongodb.com Hana Pearlman
            Reporter:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: