/// <summary>
        /// Invoke view component
        /// </summary>
        /// <returns>View component result</returns>
        public IViewComponentResult Invoke()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageUsers))
            {
                return(Content(string.Empty));
            }

            //prepare model
            var model = _commonModelFactory.PrepareCommonStatisticsModel();

            return(View(model));
        }
        /// <summary>
        /// Invoke view component
        /// </summary>
        /// <returns>View component result</returns>
        public IViewComponentResult Invoke()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers) ||
                !_permissionService.Authorize(StandardPermissionProvider.ManageProducts))
            {
                return(Content(string.Empty));
            }

            //a vendor doesn't have access to this report
            if (_workContext.CurrentVendor != null)
            {
                return(Content(string.Empty));
            }

            //prepare model
            var model = _commonModelFactory.PrepareCommonStatisticsModel();

            return(View(model));
        }
示例#3
0
        public IViewComponentResult Invoke()
        {
            var model = _commonModelFactory.PrepareCommonStatisticsModel();

            return(View(model));
        }