已完成“专业课教学任务下放学院管理”。

专业必修、专业选修、实践课程:由课程所属学院创建、修改、删除、发布和关闭。
公共必修、公共选修:仍由校级教务管理。
校级教务可以查看全校专业课任务,但不能代替学院维护。
超级管理员保留跨学院纠错权限。
教师分配统一要求:教师已申报该课程,并通过学院审核。
兼岗账号同时拥有校级公共课和本学院专业课职责。
This commit is contained in:
2026-07-24 19:43:24 +08:00 Unverified
parent e6d8eb0662
commit 5da1a8a403
5 changed files with 212 additions and 20 deletions
@@ -0,0 +1,30 @@
using Jiaowu.Api.Domain.Academic;
using Jiaowu.Api.Domain.Identity;
namespace Jiaowu.Api.Infrastructure.Auth;
public static class TeachingTaskMaintenancePolicy
{
public static bool CanManage(
CurrentUserScope scope,
Guid courseCollegeId,
CourseNature nature)
{
if (scope.IsInRole(SystemRoles.SuperAdmin)) return true;
if (scope.IsInRole(SystemRoles.AcademicAdmin) &&
IsSchoolManagedNature(nature))
return true;
return scope.IsInRole(SystemRoles.CollegeAdmin) &&
scope.CollegeId == courseCollegeId &&
IsCollegeManagedNature(nature);
}
public static bool IsCollegeManagedNature(CourseNature nature) =>
nature is CourseNature.MajorRequired or
CourseNature.MajorElective or
CourseNature.Practice;
public static bool IsSchoolManagedNature(CourseNature nature) =>
nature is CourseNature.GeneralRequired or
CourseNature.GeneralElective;
}