Rewrite ProjectControl canPerformOnAllRefs to actually mean it

In order to perform an action on all references, the user must
actually have the action.  We run into odd corner cases here,
as a RefRight on refs/heads/master immediately invalidates the
pattern on refs/* implying everything, unless the user also has
access to refs/heads/master.

Make a collection of every pattern used within the project's
access control list, and then loop through each of those and
validate that the user has access on that pattern.  If they
have it on all of them, we can assume it means the have it on
all refs if there is also a right on refs/*.

Change-Id: Iea5ffce63ec40d024753edf9c519e5ac0c3c2e71
2 files changed