diff --git a/app/graphql/types/namespaces/available_features_type.rb b/app/graphql/types/namespaces/available_features_type.rb index 21d2f584fef1dde22dd3bd9d695a479c169790e4..3b6db1868a5e341a548eaa8d670f222d8dbc0575 100644 --- a/app/graphql/types/namespaces/available_features_type.rb +++ b/app/graphql/types/namespaces/available_features_type.rb @@ -77,6 +77,13 @@ class AvailableFeaturesType < BaseObject # rubocop:disable Graphql/AuthorizeType resolver_method: :subepics_enabled?, experiment: { milestone: '18.1' } + field :has_statuses_feature, + GraphQL::Types::Boolean, + null: false, + description: 'Whether work item statuses are enabled for the namespace.', + resolver_method: :statuses_enabled?, + experiment: { milestone: '18.3' } + def epics_enabled? object.licensed_feature_available?(:epics) end @@ -116,6 +123,10 @@ def scoped_labels_enabled? def subepics_enabled? object.licensed_feature_available?(:subepics) end + + def statuses_enabled? + object.licensed_feature_available?(:work_item_status) + end end end end diff --git a/app/graphql/types/permission_types/group.rb b/app/graphql/types/permission_types/group.rb index 1ab4eedaa26daee71a772f71298e2432f3a53243..d3a04a0e1d671ec5889653e1e306ad30b9555ebe 100644 --- a/app/graphql/types/permission_types/group.rb +++ b/app/graphql/types/permission_types/group.rb @@ -6,7 +6,7 @@ class Group < BasePermissionType graphql_name 'GroupPermissions' abilities :read_group, :create_projects, :create_custom_emoji, :remove_group, :view_edit_page, - :admin_issue, :read_crm_contact, :read_crm_organization + :admin_issue, :read_crm_contact, :read_crm_organization, :admin_work_item_lifecycle permission_field :can_leave, description: 'If `true`, the user can leave this group.' diff --git a/app/graphql/types/permission_types/project.rb b/app/graphql/types/permission_types/project.rb index 73288168a58fba3991b848db45b96be96d129a71..455928a34f1076897b35ceb0782dc1a1a009321c 100644 --- a/app/graphql/types/permission_types/project.rb +++ b/app/graphql/types/permission_types/project.rb @@ -19,7 +19,7 @@ class Project < BasePermissionType :create_pages, :destroy_pages, :read_pages_content, :admin_operations, :read_merge_request, :read_design, :create_design, :update_design, :destroy_design, :move_design, :read_environment, :view_edit_page, :admin_issue, :create_work_item, - :import_issues, :read_crm_contact, :read_crm_organization + :import_issues, :read_crm_contact, :read_crm_organization, :admin_work_item_lifecycle permission_field :create_snippet diff --git a/doc/api/graphql/reference/_index.md b/doc/api/graphql/reference/_index.md index 41a8e87c5114854d228083f0413ea7bfdcb58a73..84e19bd07088648c80d352f21a6d6a5aa345e0c9 100644 --- a/doc/api/graphql/reference/_index.md +++ b/doc/api/graphql/reference/_index.md @@ -31452,6 +31452,7 @@ Returns [`String`](#string). | Name | Type | Description | | ---- | ---- | ----------- | | `adminIssue` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_issue` on this resource. | +| `adminWorkItemLifecycle` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_work_item_lifecycle` on this resource. | | `canLeave` | [`Boolean!`](#boolean) | If `true`, the user can leave this group. | | `createCustomEmoji` | [`Boolean!`](#boolean) | If `true`, the user can perform `create_custom_emoji` on this resource. | | `createProjects` | [`Boolean!`](#boolean) | If `true`, the user can perform `create_projects` on this resource. | @@ -35637,6 +35638,7 @@ four standard [pagination arguments](#pagination-arguments): | `hasOkrsFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.1. **Status**: Experiment. Whether OKRs are enabled for the namespace. | | `hasQualityManagementFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.1. **Status**: Experiment. Whether quality management is enabled for the namespace. | | `hasScopedLabelsFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.1. **Status**: Experiment. Whether scoped labels are enabled for the namespace. | +| `hasStatusesFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.3. **Status**: Experiment. Whether work item statuses are enabled for the namespace. | | `hasSubepicsFeature` {{< icon name="warning-solid" >}} | [`Boolean!`](#boolean) | **Introduced** in GitLab 18.1. **Status**: Experiment. Whether subepics are enabled for the namespace. | ### `NamespaceBan` @@ -39875,6 +39877,7 @@ Returns [`String`](#string). | `adminProject` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_project` on this resource. | | `adminRemoteMirror` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_remote_mirror` on this resource. | | `adminWiki` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_wiki` on this resource. | +| `adminWorkItemLifecycle` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_work_item_lifecycle` on this resource. | | `archiveProject` | [`Boolean!`](#boolean) | If `true`, the user can perform `archive_project` on this resource. | | `changeNamespace` | [`Boolean!`](#boolean) | If `true`, the user can perform `change_namespace` on this resource. | | `changeVisibilityLevel` | [`Boolean!`](#boolean) | If `true`, the user can perform `change_visibility_level` on this resource. | diff --git a/ee/spec/graphql/ee/types/namespaces/available_features_type_spec.rb b/ee/spec/graphql/ee/types/namespaces/available_features_type_spec.rb index 9e3aed3dfde48034da08569f2dbb3d12bcaa9a92..807fca654cfcd380bb6a712c13df1d78610a2a50 100644 --- a/ee/spec/graphql/ee/types/namespaces/available_features_type_spec.rb +++ b/ee/spec/graphql/ee/types/namespaces/available_features_type_spec.rb @@ -19,6 +19,7 @@ :has_quality_management_feature | :quality_management :has_scoped_labels_feature | :scoped_labels :has_subepics_feature | :subepics + :has_statuses_feature | :work_item_status end with_them do diff --git a/spec/graphql/types/permission_types/group_spec.rb b/spec/graphql/types/permission_types/group_spec.rb index f05b0bf1721bc0e3d95faae2129b33238ae730e2..47a259f98d4def190b8cfbac18c3b39c31a074d0 100644 --- a/spec/graphql/types/permission_types/group_spec.rb +++ b/spec/graphql/types/permission_types/group_spec.rb @@ -8,7 +8,7 @@ it 'has the correct permissions' do expected_permissions = [ :read_group, :create_projects, :create_custom_emoji, :remove_group, :view_edit_page, :can_leave, - :admin_issue, :read_crm_contact, :read_crm_organization + :admin_issue, :read_crm_contact, :read_crm_organization, :admin_work_item_lifecycle ] expected_permissions.each do |permission| diff --git a/spec/graphql/types/permission_types/project_spec.rb b/spec/graphql/types/permission_types/project_spec.rb index 3e73b22f8c0e7e1a2253dbffe9c49cb39b261a60..5ea8a3fdb8c288ca9a81ed8ae7e1916b29e5410c 100644 --- a/spec/graphql/types/permission_types/project_spec.rb +++ b/spec/graphql/types/permission_types/project_spec.rb @@ -19,7 +19,7 @@ :create_pages, :destroy_pages, :read_pages_content, :admin_operations, :read_merge_request, :read_design, :create_design, :update_design, :destroy_design, :move_design, :read_environment, :view_edit_page, :admin_issue, :create_work_item, - :import_issues, :read_crm_contact, :read_crm_organization + :import_issues, :read_crm_contact, :read_crm_organization, :admin_work_item_lifecycle ] expected_permissions.each do |permission| diff --git a/spec/support/shared_examples/graphql/types/namespaces/available_features_shared_examples.rb b/spec/support/shared_examples/graphql/types/namespaces/available_features_shared_examples.rb index 953e66d86870971a610b5ce8d1e872231bf97519..2d62bfd91bea33dcd5b432274b714928a7b99aea 100644 --- a/spec/support/shared_examples/graphql/types/namespaces/available_features_shared_examples.rb +++ b/spec/support/shared_examples/graphql/types/namespaces/available_features_shared_examples.rb @@ -8,7 +8,7 @@ specify do expected_fields = %i[has_issue_weights_feature has_iterations_feature has_okrs_feature has_subepics_feature has_issuable_health_status_feature has_epics_feature has_scoped_labels_feature has_quality_management_feature - has_linked_items_epics_feature has_issue_date_filter_feature] + has_linked_items_epics_feature has_issue_date_filter_feature has_statuses_feature] expect(described_class).to have_graphql_fields(*expected_fields) end