Add authorize_granular_token skip_reason: :parent_authorizes to WorkItemStatus, WorkItemType, NamespaceAvailableFeatures

What does this MR do and why?

Adds authorize_granular_token skip_reason: :parent_authorizes to four GraphQL types that were listed in config/authz/graphql/authorization_todo.txt without a granular token directive. Each type is only reachable through a parent type that already declares its own authorize_granular_token directive, so skip_reason: :parent_authorizes is the correct annotation per the GPAT GraphQL implementation guide.

Types updated:

  • WorkItemStatus (ee/app/graphql/types/work_items/status_type.rb) — reachable via three paths, each gated on read_work_item: (1) WorkItem → WorkItemWidgetStatus, where the parent WorkItem type declares read_work_item (project boundary); (2) Query.workItemAllowedStatuses, which carries its own field-level granular_scope_directive (read_work_item, user boundary); (3) Group.statuses (NamespaceType#statuses), where GroupType only gates read_group, so the field carries its own granular_scope_directive (read_work_item, group boundary).
  • WorkItemType (app/graphql/types/work_items/type_type.rb) — child of WorkItem, Group, and Project types, all of which already declare their own granular token directives.
  • WorkItemFeatures (app/graphql/types/work_items/features_type.rb) — child of WorkItem; parent WorkItem type already declares read_work_item with project boundary.
  • NamespaceAvailableFeatures (app/graphql/types/namespaces/available_features_type.rb) — child of NamespaceType/GroupType, which declares read_group with group boundary.

The four corresponding entries are removed from authorization_todo.txt.

References

Screenshots or screen recordings

N/A — no UI changes.

How to set up and validate locally

  1. Run bundle exec rake gitlab:permissions:validate to confirm no validation errors for these four types.
  2. Run the affected specs:
    • bin/rspec spec/requests/api/graphql/work_item_spec.rb -e "WorkItemType child type"
    • bin/rspec ee/spec/requests/api/graphql/work_item_spec.rb -e "status widget"
    • bin/rspec ee/spec/requests/api/graphql/namespaces/licensed_features_spec.rb -e "granular PAT"
    • bin/rspec ee/spec/requests/api/graphql/namespace/statuses_spec.rb -e "granular PAT"
    • bin/rspec ee/spec/requests/api/graphql/work_item_allowed_statuses_spec.rb -e "granular PAT"

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marc Saleiko

Merge request reports

Loading
Loading