-
Notifications
You must be signed in to change notification settings - Fork 0
DBP-130: 允許指定題目的可見群組 #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "pan93412/dbp-130-\u5141\u8A31\u6307\u5B9A\u984C\u76EE\u7684\u53EF\u898B\u7FA4\u7D44"
Conversation
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
There was a problem hiding this 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_scopefield 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.