Exemple #1
0
        public bool CanEditPost(int postID, int userID)
        {
            if (userID == 0)
            {
                return(false);
            }

            if (_roleServices.UserHasSpecialPermissions(userID, SpecialPermissionValue.Administrator, SpecialPermissionValue.Moderator))
            {
                return(true);
            }

            Post   post   = GetPost(postID);
            Thread thread = post.Thread;

            if (thread.IsLocked)
            {
                return(false);
            }
            else if (post.UserID == userID)
            {
                return((DateTime.UtcNow - post.Date).TotalSeconds < SiteConfig.TimeLimitToEditPost.IntValue());
            }

            return(false);
        }
Exemple #2
0
 public bool CanLock(User user)
 {
     if (user == null)
     {
         return(false);
     }
     return(_roleServices.UserHasSpecialPermissions(user.UserID, SpecialPermissionValue.Administrator, SpecialPermissionValue.Moderator));
 }
 public bool CanLock(int forumID, int userID)
 {
     if (userID == 0)
     {
         return(false);
     }
     return(_roleServices.UserHasSpecialPermissions(userID, SpecialPermissionValue.Moderator, SpecialPermissionValue.Administrator));
 }