Edwin Kempin fd66d86b5d VisibleRefFilter: Hide refs for draft comments and stars of other users
When NoteDb is enabled draft comments and starred changes are stored in
special refs inside the All-Users repository. These refs should only be
visible to the owning user (and users which can view all metadata), but
at the moment anyone who has read permissions to All-Users can see all
draft comments and starred changes refs.

To filter out user branches VisibleRefFilter already filters out refs
that contain an account ID, if the account ID does not match the account
ID of the current user. Parsing an account ID from a ref is implemented
in Account.fromRef(String), but so far this method is only considering
user branches. Extend this method so that it can also parse account IDs
from draft comments and starred changes refs. In draft comments and
starred changes refs the account ID follows a sharded change ID, e.g.
refs/draft-comments/73/67473/1011123. Generic logic to parse an ID that
follows a sharded ID is added to RefNames.

Change-Id: Id3d764f9098ee9f7ec6d233656d904e2f4c4a576
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-07-04 16:07:52 +02:00
..
2016-12-07 11:33:07 +00:00