Example #1
0
        public static SiteContext GetSiteContext(UserProfile profile)
        {
            SiteContext SiteContext = new SiteContext();

            SiteContext.MediaDomainName = SiteConfig.MediaDomainName;
            SiteContext.SiteName        = SiteConfig.SiteName;
            SiteContext.SiteURL         = SiteConfig.SiteURL;
            SiteContext.Udc             = UserDataContext.GetUserDataContext();
            SiteContext.UserProfile     = profile;
            return(SiteContext);
        }
Example #2
0
        public bool CurrentUserHasAccess(string securityArea)
        {
            SecurityAreaElement currentSecurityArea = this.SecurityAreas[securityArea];

            if (currentSecurityArea != null && currentSecurityArea.Roles.Contains(UserDataContext.GetUserDataContext().UserRole))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }