Advanced search: Add planner role support to comments

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

The planner role was introduced in #482733 (closed).

Comments (notes) search is dependent upon project visibility_level and multiple feature_access_level values (notes are indexed for multiple data types).

Comments search does not work for notes on merge requests for users with planner role

https://docs.gitlab.com/user/permissions/#project-planning

Proposal

Fully implement the planner role for notes search. The NoteClassProxy class is where the Elasticsearch query is built. This is where the bug lies, somehow the feature access level settings are not granting planner when they should be

We should convert notes during this time to using the Query Builder pattern. This could be done while fixing the bug and put everything behind a feature flag to reduce risk.

note: Update role and permissions docs (search was introduced in !189550 (merged))

Edited by 🤖 GitLab Bot 🤖