Skip to content

Restrict acadadmin course access by role and update Summer course lookups#1933

Merged
vikrantwiz02 merged 2 commits into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:prod/acad-react
Jul 19, 2026
Merged

Restrict acadadmin course access by role and update Summer course lookups#1933
vikrantwiz02 merged 2 commits into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:prod/acad-react

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

This pull request updates how the year is determined when querying CourseInstructor records, ensuring consistency with how CourseInstructor stores Odd/Summer and Even semesters. A new helper function course_instructor_year is introduced and used throughout the codebase to prevent mismatches and access errors, especially for instructor-based queries and permission checks.

Academic year handling improvements:

  • Added the course_instructor_year helper function to encapsulate the logic for determining the correct year to use when querying CourseInstructor for a given academic year and semester type.
  • Updated all queries to CourseInstructor in the post method and related permission checks to use course_instructor_year instead of working_year, ensuring instructors are matched to the correct courses and semesters. [1] [2] [3] [4] [5]

Role and permission logic:

  • Improved acadadmin role checks by introducing the acting_as_acadadmin variable, ensuring that admin-specific logic is only applied when the user is actually acting as an academic admin. [1] [2]

…designation

- SubmitGradesProfAPI and UploadGradesProfAPI now treat a user as acadadmin
  only when acting as acadadmin (Role=acadadmin) AND holding the designation
- Fixes faculty who also hold acadadmin seeing all courses / bypassing the
  instructor-ownership check while submitting as faculty
…ookups

CourseInstructor stores Odd/Summer under the start year and Even under the end
year, but parse_academic_year keys Summer on the end year (to match Student_grades).
Add course_instructor_year() helper and use it for every CourseInstructor filter
(submit dropdown, upload ownership, download grades, PDF, grade status) so a
faculty's Summer courses are found. parse_academic_year and Student_grades storage
are left unchanged.
@vikrantwiz02
vikrantwiz02 merged commit 6e0737c into FusionIIIT:prod/acad-react Jul 19, 2026
1 check passed
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.

1 participant