Add permission check to API calls to make sure no useless API calls are made
Currently, for committers and contributors section, if the user doesn't have permission to see it, front end will still make those API calls and get a 403 response.
We can add check before making those calls to reduce/remove useless API calls.