Merge "Cache RefControl.isVisible()"
This commit is contained in:
		@@ -58,6 +58,7 @@ public class RefControl {
 | 
				
			|||||||
  private Boolean owner;
 | 
					  private Boolean owner;
 | 
				
			||||||
  private Boolean canForgeAuthor;
 | 
					  private Boolean canForgeAuthor;
 | 
				
			||||||
  private Boolean canForgeCommitter;
 | 
					  private Boolean canForgeCommitter;
 | 
				
			||||||
 | 
					  private Boolean isVisible;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  RefControl(ProjectControl projectControl, String ref,
 | 
					  RefControl(ProjectControl projectControl, String ref,
 | 
				
			||||||
      PermissionCollection relevant) {
 | 
					      PermissionCollection relevant) {
 | 
				
			||||||
@@ -103,8 +104,12 @@ public class RefControl {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  /** Can this user see this reference exists? */
 | 
					  /** Can this user see this reference exists? */
 | 
				
			||||||
  public boolean isVisible() {
 | 
					  public boolean isVisible() {
 | 
				
			||||||
    return (getCurrentUser() instanceof InternalUser || canPerform(Permission.READ))
 | 
					    if (isVisible == null) {
 | 
				
			||||||
        && canRead();
 | 
					      isVisible =
 | 
				
			||||||
 | 
					          (getCurrentUser() instanceof InternalUser || canPerform(Permission.READ))
 | 
				
			||||||
 | 
					              && canRead();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return isVisible;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user