Fix ls-user-ref and use the correct identity for listing refs

The ls-user-ref was broken by Change-Id: I1819de0bab where
the refactoring of the permission backend needed to be passed
the current user as parameter. As a result, the LsUserRefs, started
using the user's identity executing the command instead of the one
requested as a parameter.

Bug: Issue 11235
Change-Id: I48b6e14a2fe24d3d2a96a8274bd9e0108dc0c95d
This commit is contained in:
Luca Milanesio
2019-07-25 08:11:17 -05:00
parent 9f1ab6a46b
commit d2a9ad8ead

View File

@@ -92,7 +92,7 @@ public class LsUserRefs extends SshCommand {
try {
Map<String, Ref> refsMap =
permissionBackend
.user(user)
.user(ctx.getUser())
.project(projectName)
.filter(repo.getRefDatabase().getRefs(ALL), repo, RefFilterOptions.defaults());