Show all access rights in WebUI if user can read refs/meta/config

Users who can read the refs/meta/config branch, can see all access
rights by fetching this branch and looking at the project.config file.
With this change they can now see the same information in the WebUI.

Change-Id: I213d34343e1547f45fd15271fdd763b963c9d25e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ProjectAccessFactory.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ProjectAccessFactory.java
index 7ac4ec3..c3e00f5 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ProjectAccessFactory.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/project/ProjectAccessFactory.java
@@ -110,6 +110,7 @@
       md.close();
     }
 
+    final RefControl metaConfigControl = pc.controlForRef(GitRepositoryManager.REF_CONFIG);
     List<AccessSection> local = new ArrayList<AccessSection>();
     Set<String> ownerOf = new HashSet<String>();
     Map<AccountGroup.UUID, Boolean> visibleGroups =
@@ -125,7 +126,7 @@
 
       } else if (RefConfigSection.isValid(name)) {
         RefControl rc = pc.controlForRef(name);
-        if (rc.isOwner()) {
+        if (rc.isOwner() || metaConfigControl.isVisible()) {
           local.add(section);
           ownerOf.add(name);
 
@@ -195,8 +196,7 @@
 
     detail.setLocal(local);
     detail.setOwnerOf(ownerOf);
-    detail.setConfigVisible(pc.isOwner()
-        || pc.controlForRef(GitRepositoryManager.REF_CONFIG).isVisible());
+    detail.setConfigVisible(pc.isOwner() || metaConfigControl.isVisible());
     return detail;
   }