Пример #1
0
 /// <summary>
 /// 检查特殊用户权限
 /// </summary>
 /// <param name="permUserList">特殊用户列表</param>
 /// <param name="userId">查看权限用户ID</param>
 /// <param name="forumSpecialUserPower">论坛特殊用户权限</param>
 /// <returns></returns>
 private static bool ValidateSpecialUserPerm(string permUserList, int userId, ForumSpecialUserPower forumSpecialUserPower)
 {
     if (!Utils.StrIsNullOrEmpty(permUserList))
     {
         ForumSpecialUserPower forumspecialuserpower = (ForumSpecialUserPower)GetForumSpecialUserPower(permUserList, userId);
         if (((int)(forumspecialuserpower & forumSpecialUserPower)) > 0)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #2
0
 private static bool ValidateSpecialUserPerm(string permUserList, int userId, ForumSpecialUserPower forumSpecialUserPower)
 {
     if (!permUserList.IsNullOrEmpty())
     {
         ForumSpecialUserPower forumSpecialUserPower2 = (ForumSpecialUserPower)Forums.GetForumSpecialUserPower(permUserList, userId);
         if ((forumSpecialUserPower2 & forumSpecialUserPower) > (ForumSpecialUserPower)0)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #3
0
 protected int GetPower(int power, ForumSpecialUserPower thePower)
 {
     return power |= (int)thePower;
 }
Пример #4
0
 protected bool IsPower(int power, ForumSpecialUserPower thePower)
 {
     return (power & (int)thePower) != 0;
 }
Пример #5
0
 protected string GetPowerImg(int power, ForumSpecialUserPower thePower)
 {
     return IsPower(power, thePower) ? "access_allow.gif" : "access_normal.gif";
 }
Пример #6
0
 /// <summary>
 /// 检查特殊用户权限
 /// </summary>
 /// <param name="permUserList">特殊用户列表</param>
 /// <param name="userId">查看权限用户ID</param>
 /// <param name="forumSpecialUserPower">论坛特殊用户权限</param>
 /// <returns></returns>
 private static bool ValidateSpecialUserPerm(string permUserList, int userId, ForumSpecialUserPower forumSpecialUserPower)
 {
     if (!Utils.StrIsNullOrEmpty(permUserList))
     {
         ForumSpecialUserPower forumspecialuserpower = (ForumSpecialUserPower)GetForumSpecialUserPower(permUserList, userId);
         if (((int)(forumspecialuserpower & forumSpecialUserPower)) > 0)
             return true;
     }
     return false;
 }