authz: introduce FilePermissionsFunc
Created by: keegancsmith
This function will be used for a more efficient implementation of permission operations which occur over many files.
Test Plan: go test
Part of https://github.com/sourcegraph/sourcegraph/issues/41347
plz-review-url: https://plz.review/review/11271