コード例 #1
0
ファイル: Grant.cs プロジェクト: Meytol/Foodtopia
        public Grant(IHttpContextAccessor httpContextAccessor, IAuthenticationCookieService authCookieService, IAuthenticationSessionService authSessionService, IAuthorizeService authorizeService,
                     AuthorizeLevel grantType = AuthorizeLevel.NeedAuthorize, GrantPriority grantPriority = GrantPriority.Default)
        {
            _httpContextAccessor = httpContextAccessor;
            _authCookieService   = authCookieService;
            _authSessionService  = authSessionService;
            _authorizeService    = authorizeService;

            _grantType               = grantType;
            _httpContext             = _httpContextAccessor.HttpContext;
            _isAuthenticationChecked = "IsAuthenticationChecked";

            _grantPriority = grantPriority;
        }
コード例 #2
0
        /// <summary>
        /// 使用指定的授权级别对操作进行授权
        /// 当授权级别为中级以上时
        ///
        /// </summary>
        /// <param name="level">授权级别</param>
        public UserAuthorizeAttribute(AuthorizeLevel level)

        {
            this.Level = level;
        }