Пример #1
0
        /// <summary>
        /// Ensure that a manager can access a venue. Throw an error if not.
        /// </summary>
        /// <param name="managerId">Manager ID</param>
        /// <param name="venueId">Venue ID</param>
        private async Task _EnsureManagerCanAccessVenue(string managerId, string venueId)
        {
            // Check that the manager can access the venue.
            bool managerCanAccess = await _database.ManagerCanAccessVenue(managerId, venueId);

            // If the manager does not have access, throw an error.
            if (!managerCanAccess)
            {
                throw new NoAccessException();
            }
        }