Merge "Also check if user can upload in order to restore"

This commit is contained in:
Martin Fick
2012-06-27 16:40:20 -07:00
committed by gerrit code review
2 changed files with 5 additions and 1 deletions

View File

@@ -452,6 +452,9 @@ This category controls whether users are allowed to abandon changes
to projects in Gerrit. It can give permission to abandon a specific
change to a given ref.
This also grants the permission to restore a change if the change
can be uploaded.
[[category_create]]
Create reference
~~~~~~~~~~~~~~~~

View File

@@ -211,7 +211,8 @@ public class ChangeControl {
/** Can this user restore this change? */
public boolean canRestore() {
return canAbandon(); // Anyone who can abandon the change can restore it back
return canAbandon() // Anyone who can abandon the change can restore it back
&& getRefControl().canUpload(); // as long as you can upload too
}
/** All value ranges of any allowed label permission. */