Ejemplo n.º 1
0
        public virtual async Task <IActionResult> Show(int id)
        {
            var propertySettings = Engine.Settings.Property;

            if (!propertySettings.Enabled || !propertySettings.ShowItem)
            {
                return(NotFound());
            }

            ShowPropertyModel um = new ShowPropertyModel()
            {
                Property = await _property.GetPropertyByIdAsync(id)
            };

            if (um.Property == null)
            {
                return(RedirectToAction("NotFound"));
            }

            // if not admin, and not published, hide.
            if (!(User.IsEditorOrBetter()) && um.Property.Status != ContentStatus.Published)
            {
                return(RedirectToAction("NotFound"));
            }

            return(View(um));
        }
Ejemplo n.º 2
0
        public virtual async Task <IActionResult> Modal(int id)
        {
            ShowPropertyModel um = new ShowPropertyModel()
            {
                Property = await _property.GetPropertyByIdAsync(id)
            };

            // if not admin, and not published, hide.
            if (!User.IsEditorOrBetter() && um.Property.Status != ContentStatus.Published)
            {
                return(NotFound());
            }

            return(View(um));
        }