)]}'
{
  "commit": "ec36cba6080bac72790c7875c36f5b86fc55372c",
  "tree": "734b54a9ee374c41e2dd706a736ac34d768917c8",
  "parents": [
    "f94a1643f8b2676a774d9de87071dccdea82a74f"
  ],
  "author": {
    "name": "Kamil Musin",
    "email": "kamilm@google.com",
    "time": "Wed Jul 24 15:32:36 2024 +0200"
  },
  "committer": {
    "name": "Kamil Musin",
    "email": "kamilm@google.com",
    "time": "Thu Jul 25 12:55:52 2024 +0200"
  },
  "message": "Fix onBehalfOf behaviour of Submit\n\nWhen submitting changes using onBehalfOf only permission of the user\ntriggering the Submit need to be considered. With an Ic6dbda6de that\nlogic got broken, it was no longer possible to submit changes on behalf\nof another user, if that user didn\u0027t have the SUBMIT permission\nthemselves.\n\nThis change fixes this issue by using IdentifiedUser.getRealUser() in\nMergeOp where appropriate based on the situation.\n\nAdditionally as part of this change we address the pre-existing issue,\nwhere the SUBMIT_AS permission for active user and READ permission for\non-behalf-of user would only be checked for the triggering change and\nnot for all changes in the Submission. This lead to potential cases of\nsubmitting changes as part of the topic that they would otherwise lack\npermissions to submit. The extra checks for the \"current change\" in\nSubmit.java are kept, to allow the possibility of an early exit, as\nconstruction of the full Set of changes to be submitted together is an\nexpensive task.\n\nBy using real user and on-behalf-of user in MergeOp we are able to\naddress another issue, where only READ permission of the on-behalf-of\nuser were considered when constructing Merge Set. With this change we\nuse real user\u0027s permission for constructing the Merge Set, but also\nvalidate on-behalf-of READ permissions as well once it\u0027s constructed.\n\nWe also fix the permission check in ProjectConfigValidator, where\non-behalf-of user would be previously checked instead of the real user\nperforming the Submit.\n\nAlso added some class docstrings for some of the classes, that I ran\nacross during investigation.\n\nRelease-Notes: skip\nGoogle-Bug-Id: b/351138952\nChange-Id: Ib126d5fb75ab46620e302d35aa4a75699739732c\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7d531ff831ad9f2622cfcd80190e7280cc6d356d",
      "old_mode": 33188,
      "old_path": "Documentation/access-control.txt",
      "new_id": "a179905467a43bf189ab20a6b6afc1d04ecdfeb0",
      "new_mode": 33188,
      "new_path": "Documentation/access-control.txt"
    },
    {
      "type": "modify",
      "old_id": "79d53ac4531fc74cf1e19afcbb7d5f66c2426ee7",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/git/validators/MergeValidationListener.java",
      "new_id": "a51a425ccca8c39238b8ebb056dd78d1812c6677",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/git/validators/MergeValidationListener.java"
    },
    {
      "type": "modify",
      "old_id": "710e688442e87a2ad6f86885c98f971b72d6389c",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/git/validators/MergeValidators.java",
      "new_id": "c8a3d1e73216c9ec708d27e7cc6b50569314dc56",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/git/validators/MergeValidators.java"
    },
    {
      "type": "modify",
      "old_id": "0a47d62f58656b82d2840cc17d18dca30896a045",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/restapi/change/Submit.java",
      "new_id": "6b3517556e8ae73083467e8052f0056ba05a0c34",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/restapi/change/Submit.java"
    },
    {
      "type": "modify",
      "old_id": "233f00e96ab297d6665406c9fbf17149235d033f",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/submit/MergeOp.java",
      "new_id": "d49638a2852b19fa554f073cb9465b42b7ad9297",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/submit/MergeOp.java"
    },
    {
      "type": "modify",
      "old_id": "2f9ef84744b119f95f8f2470d5d2a8a434524fbf",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/update/BatchUpdates.java",
      "new_id": "47162461b71cf7b646ff08303cac555d130d0bca",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/update/BatchUpdates.java"
    },
    {
      "type": "modify",
      "old_id": "762de57af1136e10b0f8d748fb7e7305e279a9dc",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/update/SubmissionExecutor.java",
      "new_id": "ff46181acf9f3ac3366adec419e489d29db56d62",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/update/SubmissionExecutor.java"
    },
    {
      "type": "modify",
      "old_id": "2e706b804c819c07f9a5682f246f6cda751c135d",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/acceptance/rest/account/ImpersonationIT.java",
      "new_id": "7de689d695290062c8f0fae178e5085c29709534",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/acceptance/rest/account/ImpersonationIT.java"
    },
    {
      "type": "modify",
      "old_id": "4ee596767f62537bbfd305a24922c6743272b5cc",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/acceptance/server/change/SubmittedTogetherIT.java",
      "new_id": "6fabd1a9ac99b4cb7a0a1102e7bb6e90b2013d9c",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/acceptance/server/change/SubmittedTogetherIT.java"
    }
  ]
}
