Ensure project snippet feature status in project snippet api endpoints
When the project snippet feature is disabled, users can't access any snippet from that project or perform any action at all. Nevertheless, the are several endpoints and actions we don't perform the check and we could improve the response time of other endpoints.
In the SHOW, UPDATE, INDEX, DELETE, and RAW endpoints, we ensure that by calling the SnippetsFinder whose query ensures the requirement is met. Nevertheless, the query is not very fast and we could improve the endpoint response time by just returning a 404 if the snippet feature is disabled before calling the SnippetsFinder.
Besides, for the CREATE, and the AGENT_DETAILS endpoint I don't think we ensure the feature visibility.
Edited by 🤖 GitLab Bot 🤖