Skip to content

Conversation

@pan93412
Copy link
Member

@pan93412 pan93412 commented Nov 3, 2025

  • feat(schema): add visible_scope to Question
  • chore(ent): regenerate schema
  • feat(graph): implement visible_scope filtering
  • fix(graph): correct totalQuestions and categories filtering

@pan93412 pan93412 self-assigned this Nov 3, 2025
@linear
Copy link

linear bot commented Nov 3, 2025

@pan93412 pan93412 requested a review from Copilot November 3, 2025 20:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a visibility scope feature for questions, allowing administrators to restrict question access based on user permissions. The new visible_scope field enables fine-grained control over which users can view, update, delete, and submit answers to specific questions.

  • Adds an optional visible_scope field to the Question schema
  • Implements scope-based filtering for question queries and mutations
  • Adds comprehensive test coverage for all scope-related access control scenarios

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ent/schema/question.go Adds visible_scope optional string field to Question entity
graph/question.resolvers.go Implements checkQuestionVisibleScope and applyQuestionVisibleScopeFilter functions for access control
graph/ent.resolvers.go Applies visible scope filter to the Questions query
graph/ent.graphqls Adds GraphQL schema definitions for visibleScope field
graph/submission_statistics_test.go Tests that submission statistics respect visible_scope filtering
graph/question_resolver_test.go Tests question CRUD operations and queries with visible_scope restrictions
ent/question.go, ent/mutation.go, ent/question_create.go, ent/question_update.go, ent/question/question.go, ent/question/where.go, ent/migrate/schema.go, ent/internal/schema.go, ent/gql_where_input.go, ent/gql_mutation_input.go, ent/gql_collection.go Generated Ent framework code for the new visible_scope field

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pan93412 pan93412 merged commit 5e27963 into main Nov 3, 2025
2 checks passed
@pan93412 pan93412 deleted the pan93412/dbp-130-允許指定題目的可見群組 branch November 3, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants