Example #1
0
        private bool IsNotAuthenticated(XUserSession session)
        {
            if (session == null || session.XUserInfo == null)
            {
                return(false);
            }

            return(session.XUserInfo.State == UserState.NotAuthenticated);
        }
Example #2
0
        private bool IsNormal(XUserSession session)
        {
            if (session == null || session.XUserInfo == null)
            {
                return(false);
            }

            return(session.XUserInfo.State == UserState.Normal);
        }
Example #3
0
        private bool IsNotIllegal(XUserSession session)
        {
            if (session == null || session.XUserInfo == null)
            {
                return(false);
            }

            var request = BusinessRequest as ApiRequest;

            return(session.XUserInfo.AuthId.Equals(request.AuthId));
        }
Example #4
0
        protected XUserSession Build()
        {
            var session = GetSession();

            if (session == null)
            {
                session = new XUserSession();
            }

            session.XUserInfo       = SessionDto;
            session.UserAuthId      = SessionDto.AuthId;
            session.IsAuthenticated = SessionDto.State == UserState.Normal;

            return(session);
        }