예제 #1
0
        // [Authorize(Roles = "admin")]
        public ActionResult <IEnumerable <string> > Get() // для админа
        {
            string     login      = HttpContext.User.Identity.Name;
            StackTrace stackTrace = new StackTrace();
            string     methodName = stackTrace.GetFrame(0).GetMethod().Name;

            if (_userService.AccessCheck(login, methodName))
            {
                return(Ok(new string[] { "value1", "value2" }));
            }
            return(BadRequest());
        }