Only show reviewer removal buttons when removal is allowed

Don't bother showing the "X" remove button unless the user can
actually perform this action at the time that the page was shown.
This hides the removal flag for users who have voted a negative
score, unless you are the project administrator.  It also hides
the flag unless the row is for yourself, or you are the change
owner or the project's administrator.

Change-Id: I30f3cf5081b8126ebf6644b4c64ce76c35dc1e88
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-04-24 13:14:06 -07:00
parent 73915b0ddf
commit 0134d1f533
3 changed files with 19 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ public class ApprovalDetail {
protected Account.Id account;
protected List<PatchSetApproval> approvals;
protected boolean canRemove;
private transient int hasNonZero;
private transient Timestamp sortOrder = EG_D;
@@ -57,6 +58,14 @@ public class ApprovalDetail {
return account;
}
public boolean canRemove() {
return canRemove;
}
public void setCanRemove(boolean removeable) {
canRemove = removeable;
}
public Map<ApprovalCategory.Id, PatchSetApproval> getApprovalMap() {
final HashMap<ApprovalCategory.Id, PatchSetApproval> r;
r = new HashMap<ApprovalCategory.Id, PatchSetApproval>();