Example #1
0
        protected override bool AuthorizeCore(System.Web.HttpContextBase httpContext)
        {
            var user = UnityRegistrator.Container.Resolve <IAuthService>().CurrentUser;

            if (user == null)
            {
                return(false);
            }
            if (!Emails.IsEmpty())
            {
                return(Emails.Split(',').Any(e => e + "@specialist.ru" == user.Email));
            }
            if (RoleList != Role.None)
            {
                return(user.InRole(RoleList));
            }
            return(true);
        }