Esempio n. 1
0
        public async Task <ActionResult> CreateVenueAsync(VenueVm venueVm)
        {
            var userId     = User.FindFirst(ClaimTypes.NameIdentifier).Value;
            var organizers = await _securityService.GetOrganizersUserIsAdminAtAsync(userId);

            if (!organizers.Any(a => a.Id == venueVm.OrganizerId))
            {
                return(Forbid());
            }

            await _venueService.CreateVenueAsync(venueVm);

            Log.Information("Venue {@venueVm} saved to db", venueVm);
            return(Ok());
        }