Implement Duo Workflow feature checks in Rails

We want to add checks for Duo Workflow permissions and expose them through rails graphql API.

Duo Workflow permissions

  1. Current project is on an Ultimate plan
  2. Current project has AI enabled
  3. Current project has experimental setting enabled for AI features
  4. Current user has access to the AI feature? Role developer or higher on the project
  5. Is the Feature flag duo_workflow enabled

The query could look like:

query getDuoWorkflowPermissions{
  project(fullPath: "gitlab-org/gitlab"){
    id
    userPermissions{
      duoWorkflow //hash to get all data {
        allowed // Boolean composite value of all checks
        checks {
          isUltimatePlan
          isDuoEnabled
          withExperimentSettings
          isUserAllowed
          isFeatureFlagEnabled
        }
      }
    }
  }
}
Assignee Loading
Time tracking Loading