用户给赋予删除自己贴子权限后仍无法删除帖子

 

修改原因:用户给赋予删除自己贴子权限后仍无法删除帖子(Bug)

修改方法:经检查为/Components/Components/ForumPermission.cs 中,AccessCheck()方法对Delete权限的判断代码中存在逻辑错误。

Step 1: 修改 /Components/Components/ForumPermission.cs

Error Soruce Code Part :

if (Globals.GetSiteSettings().PostDeleteAgeInMinutes > 0)
 //if (post.PostDate < DateTime.Now.AddMinutes(Globals.GetSiteSettings().PostDeleteAgeInMinutes))
 // -> chaozi 25/09/04 : 逻辑错误 正确逻辑应为:发帖时间 + 配置删除间隔时间 > 当前时间

 if (post.PostDate.AddMinutes(Globals.GetSiteSettings().PostDeleteAgeInMinutes) > DateTime.Now)
  throw new ForumException(ForumExceptionType.PostDeletePermissionExpired);

另外在配置设置中没有提供对PostDeleteAgeInMinutes 设置的UI接口,只提供了对PostEditAgeInMinutes的设置,需要加上。

posted on 2004-11-02 11:21  超子  阅读(263)  评论(0编辑  收藏  举报

导航