예제 #1
0
        private bool IsAuthorizedMealFoodOperation(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement, MealFood mealFood)
        {
            if (requirement.Name == Constants.ReadOperationName)
            {
                return(true);
            }
            //Get the sesshin tenzo
            string mealFoodOwner = _mealService.GetMealSesshinOwner(mealFood.MealId);

            return(mealFoodOwner == _userManager.GetUserId(context.User));
        }