diff options
author | Shawn Pearce <sop@google.com> | 2014-05-29 09:32:59 -0700 |
---|---|---|
committer | Shawn Pearce <sop@google.com> | 2014-05-29 09:32:59 -0700 |
commit | b8dd435dec4f73342ee6c5709e5c785bbdaa7cc6 (patch) | |
tree | c5b6993637450372b69d218bf89a58989014731d | |
parent | 4b106624eb270eb2cc5f41eb0adff5d8b307717f (diff) |
SideBySide2: Do not offer 'r' keybinding to anonymous users
Anonymous users cannot mark a file as reviewed, as the server
has no way to track the stored flag. Disable the keybinding
so it does not appear in the help dialog.
Change-Id: I415a24754d1b4b5120b5b40e074ee697cf921b52
-rw-r--r-- | gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SideBySide2.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SideBySide2.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SideBySide2.java index 364d94cbb5..7d8ee978fb 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SideBySide2.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/SideBySide2.java @@ -421,12 +421,14 @@ public class SideBySide2 extends Screen { keysAction.add(new NoOpKeyCommand(0, 'o', PatchUtil.C.expandComment())); keysAction.add(new NoOpKeyCommand( KeyCommand.M_SHIFT, 'o', PatchUtil.C.expandAllCommentsOnCurrentLine())); - keysAction.add(new KeyCommand(0, 'r', PatchUtil.C.toggleReviewed()) { - @Override - public void onKeyPress(KeyPressEvent event) { - header.toggleReviewed().run(); - } - }); + if (Gerrit.isSignedIn()) { + keysAction.add(new KeyCommand(0, 'r', PatchUtil.C.toggleReviewed()) { + @Override + public void onKeyPress(KeyPressEvent event) { + header.toggleReviewed().run(); + } + }); + } keysAction.add(new KeyCommand( KeyCommand.M_SHIFT, 'm', PatchUtil.C.markAsReviewedAndGoToNext()) { @Override |