More in this section
Forums / Bugs & Issues / Login/Logout button System.UnauthorizedAccessException error with Custom MvcWidget (Sitefinity v9.2.6200.0)

Login/Logout button System.UnauthorizedAccessException error with Custom MvcWidget (Sitefinity v9.2.6200.0)

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Yiğitcan
    Yiğitcan avatar
    0 posts
    Registered:
    23 Jun 2016
    12 Jan 2017
    Link to this post
    I've seen similar problems but solutions don't apply to my case.

    I have a page with a simple MVC Widget in it. Widget's code is quite simple.

    When i try to logout using Sitefinity's default login/logout button, i'm getting;

    [UnauthorizedAccessException: bu sayfayı ve alt sayfalarını görüntüle' ('Pages') için yetkilendirilmediniz.] DynamicModule.ns.Wrapped_OpenAccessPageProvider_e43ba30d3f5b4564bb781235ba0b116a.GetPageNode(Guid id) +301 Telerik.Sitefinity.Modules.Pages.PageManager.GetPageNode(Guid id) +37 Telerik.Sitefinity.Frontend.Resources.PackageManager.GetPackageFromNodeId(String nodeId) +133 Telerik.Sitefinity.Frontend.Resources.PackageManager.GetPackageFromPageInfo() +703 Telerik.Sitefinity.Frontend.Resources.PackageManager.GetCurrentPackage() +101 Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.ControllerExtensions.GetKey(Controller controller) +342 Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.ControllerExtensions.GetViewEngineCollection(Controller controller, Func`1 pathTransformationsFunc) +44 Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.ControllerExtensions.UpdateViewEnginesCollection(Controller controller, Func`1 pathTransformationsFunc) +26 Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.FrontendControllerFactory.EnhanceViewEngines(Controller controller) +140 Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.FrontendControllerFactory.CreateController(RequestContext requestContext, String controllerName) +44 Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy.get_Controller() +136 Telerik.Sitefinity.Mvc.ControllerActionInvoker.TryInvokeAction(MvcProxyBase proxyControl, String& output) +46 Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy.ExecuteController() +68 Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy.OnPreRender(EventArgs e) +39 System.Web.UI.Control.PreRenderRecursiveInternal() +169 System.Web.UI.Control.PreRenderRecursiveInternal() +261 System.Web.UI.Control.PreRenderRecursiveInternal() +261 System.Web.UI.Control.PreRenderRecursiveInternal() +261 System.Web.UI.Control.PreRenderRecursiveInternal() +261 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6428

    Error message is in Turkish. It's "You are not authorized to 'View this page and its child pages' ('Pages')" in English.

    I simplified the code to this but still getting the error message.

    Controller:
    using System.Web.Mvc;
    using Telerik.Sitefinity.Mvc;

    namespace SitefinityWebApp.Mvc.Controllers
    {
        [ControllerToolboxItem(Name = "CariHareketler", Title = "Cari Hareketler", SectionName = "MvcWidgets")]
        public class CariHareketlerController : Controller
        {
            public ActionResult Index()
            {
                return View("Default");
            }
        }
    }

    Model:
    namespace SitefinityWebApp.Mvc.Models
    {
        public class CariHareketlerModel
        {
        }
    }

    When i remove the widget, error dissappears. I've seen an advice for adding;

    Manager.Provider.SuppressSecurityChecks = true;

    I've created a PackageManager object and added this to the controller's Index() method but it didn't help. Why is this happening? At the moment, two pages with two different MVC Widgets are giving the same error when trying to logout.
1 posts, 0 answered