Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //gives current user access to the analytics section
            umbraco.BusinessLogic.User currentUser = umbraco.BasePages.UmbracoEnsuredPage.CurrentUser;
            bool hasAccess = false;

            foreach (umbraco.BusinessLogic.Application a in currentUser.Applications)
            {
                if (a.alias == "analytics")
                {
                    hasAccess = true;
                    break;
                }
            }

            //add application
            if (!hasAccess)
            {
                currentUser.addApplication("analytics");
            }
        }