CandyShop / gerrit

Automatically exported from code.google.com/p/gerrit
Apache License 2.0
1 stars 0 forks source link

Cannot create branch from UI without read access to refs/* #3404

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
*****************************************************************
*****                                                       *****
***** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!!  *****
*****                                                       *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, CYANOGENMOD,  *****
***** INTERNAL ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.*****
*****                                                       *****
*****   THOSE ISSUES BELONG IN DIFFERENT ISSUE TRACKERS     *****
*****                                                       *****
*****************************************************************

Affected Version: 2.10.4

What steps will reproduce the problem?
1. Create a user with "read" and "create reference" access to refs/heads/*
2. As user, in UI or through REST API create a branch from a ref the user can 
see.

What is the expected output?
Branch created successfully.

What do you see instead?
"Code Review - Error
403 Cannot create "refs/heads/my-8-branch""

Please provide any additional information below.

The iterator at:
gerrit-server/src/main/java/com/google/gerrit/server/change/IncludedInResolver.j
ava:line 115

Claims that there are no commits.

Giving the user read access to "refs/*" solves the issue because this code is 
bypassed.

Solved in master, 2.11 by [1]

[1] https://gerrit-review.googlesource.com/#/c/59081/

Original issue reported on code.google.com by sven.sel...@sonymobile.com on 2 Jun 2015 at 8:45