Beispiel #1
0
 protected virtual async Task CheckFeaturesAsync(IAbpMethodInvocation invocation)
 {
     await _methodInvocationFeatureCheckerService.CheckAsync(
         new MethodInvocationFeatureCheckerContext(
             invocation.Method
             )
         ).ConfigureAwait(false);
 }
 protected virtual Task CheckFeaturesAsync(IAbpMethodInvocation invocation)
 {
     return(_methodInvocationFeatureCheckerService.CheckAsync(
                new MethodInvocationFeatureCheckerContext(
                    invocation.Method
                    )
                ));
 }
Beispiel #3
0
 protected virtual async Task CheckFeaturesAsync(IRocketMethodInvocation invocation)
 {
     await _methodInvocationFeatureCheckerService.CheckAsync(
         new MethodInvocationFeatureCheckerContext (
             invocation.Method
             )
         );
 }
        public async Task OnPageHandlerExecutionAsync (PageHandlerExecutingContext context, PageHandlerExecutionDelegate next) {
            if (context.HandlerMethod == null || !context.ActionDescriptor.IsPageAction ()) {
                await next ();
                return;
            }

            var methodInfo = context.HandlerMethod.MethodInfo;

            using (RocketCrossCuttingConcerns.Applying (context.HandlerInstance, RocketCrossCuttingConcerns.FeatureChecking)) {
                await _methodInvocationAuthorizationService.CheckAsync (
                    new MethodInvocationFeatureCheckerContext (methodInfo)
                );

                await next ();
            }
        }
        public async Task OnActionExecutionAsync(
            ActionExecutingContext context,
            ActionExecutionDelegate next)
        {
            if (!context.ActionDescriptor.IsControllerAction())
            {
                await next();

                return;
            }

            var methodInfo = context.ActionDescriptor.GetMethodInfo();

            using (RocketCrossCuttingConcerns.Applying(context.Controller, RocketCrossCuttingConcerns.FeatureChecking)) {
                await _methodInvocationAuthorizationService.CheckAsync(
                    new MethodInvocationFeatureCheckerContext (methodInfo)
                    );

                await next();
            }
        }