コード例 #1
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            var userManager = InjectionContainer.Get <IUserManager>();

            if (!userManager.IsLoggedIn)
            {
                return(false);
            }

            var roles = userManager.CurrentUser.Bonde.Rolles.Select(r => r.Kode);

            return(RolesArray.Any(roles.Contains));
        }