worker: apply permissions for users
Created by: asdine
This adds a function that applies user permissions to a list of repo. This function will be called by the worker to apply the permissions. It doesn't deal with the unrestricted flag, only with explicit permissions. It reuses the SetRepoPermissions and SetRepoPendingPermissions methods which already deal with most of the complexity.
Related to https://github.com/sourcegraph/sourcegraph/issues/36450
Test plan
Added a unit test