diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs index ac6afa31..53a55a43 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -1018,6 +1018,16 @@ public class Ghre_ExamServices : BaseServices UpdateStatus(long[] ids, string status) { + string sql = $@"SELECT A.RoleId, B.RoleNo, B.RoleName + FROM Ghrs_UserRole A LEFT JOIN Ghrs_Role B ON A.RoleId = B.RoleId + WHERE A.UserID = {App.User.ID} + AND A.IsEnable = 1 + AND B.IsEnable = 1 + AND B.RoleNo ='TrainingExamCancelRelease'"; + var toolbarRoles = DbAccess.QueryList(sql); + if (!toolbarRoles.Any()) + return ServiceResult.OprateFailed("暂无取消发布权限!"); + if (status != "Released" && status != "Disabled" && status != "Draft") throw new Exception("无效的状态");