Search code examples
gerritreview

Gerrit: prevent self review and only allow self submit at the same time


I want to achieve these 2 goals at the same time:

  • The code author can't approve (+2) to his own review.
  • If the review has been approved by others, only author himself can perform "submit".

For the 1st goal, I've made it according to : https://gerrit-review.googlesource.com/Documentation/prolog-cookbook.html#NonAuthorCodeReview

For the 2nd goal, currently in the gerrit I'm using, everyone of the project can click the "submit" button in the review. This is not expected.

Could you please help to figure this out?


Solution

  • You need to configure the access control to only grant submit permission to the change owner.

    In the old UI: Projects > List > PROJECT > Access > Edit

    Be sure to add the permission to Submit to the refs/heads/* reference.