Esempio n. 1
0
        /// <summary>
        /// body是否有显示的权限(主要是针对于回复可见的情况)
        /// </summary>
        /// <param name="authorizer"></param>
        /// <param name="threadId"></param>
        /// <returns></returns>
        public static bool BarThread_BodyShow(this Authorizer authorizer, long threadId)
        {
            BarThreadService service = new BarThreadService();

            BarPostService barPostService = new Bar.BarPostService();

            BarThread thread = service.Get(threadId);

            if (thread == null)
            {
                return(false);
            }

            if (!thread.IsHidden)
            {
                return(true);
            }

            if (barPostService.IsPosted(UserContext.CurrentUser == null ? 0 : UserContext.CurrentUser.UserId, threadId))
            {
                return(true);
            }


            return(BarThread_Edit(authorizer, thread));
        }
Esempio n. 2
0
        /// <summary>
        /// body是否有显示的权限(主要是针对于回复可见的情况)
        /// </summary>
        /// <param name="authorizer"></param>
        /// <param name="threadId"></param>
        /// <returns></returns>
        public static bool BarThread_BodyShow(this Authorizer authorizer, long threadId)
        {
            BarThreadService service = new BarThreadService();

            BarPostService barPostService = new Bar.BarPostService();

            BarThread thread = service.Get(threadId);

            if (thread == null)
                return false;

            if (!thread.IsHidden)
                return true;

            if (barPostService.IsPosted(UserContext.CurrentUser == null ? 0 : UserContext.CurrentUser.UserId, threadId))
                return true;

            //todo:需要判断是否已经留言过
            return BarThread_Edit(authorizer, thread);
        }