Reduce usage of ChangeControl
Reduce the usage of ChangeControl by replacing it with ChangeNotes and
CurrentUser where it was just used as a container for these.
Change return type of ChangeResource#getUser from IdentifiedUser to
CurrentUser to be more versatile and allow individual endpoints to check
if the user is an identified user. Since anonymous users can also
access some change resources it seems more consistent to only assume
that we can get a CurrentUser from ChangeResource.
Eventually, {Ref,Change,Project}Control should be package-private. This
commit is an incremental step towards that goal.
Change-Id: I6790f6f9d56240a96aa007bae140422b71c59750
This commit is contained in:
@@ -133,7 +133,7 @@ public class CatServlet extends HttpServlet {
|
||||
.check(ChangePermission.READ);
|
||||
if (patchKey.getParentKey().get() == 0) {
|
||||
// change edit
|
||||
Optional<ChangeEdit> edit = changeEditUtil.byChange(notes.getChange());
|
||||
Optional<ChangeEdit> edit = changeEditUtil.byChange(notes);
|
||||
if (edit.isPresent()) {
|
||||
revision = ObjectId.toString(edit.get().getEditCommit());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user