Exemplo n.º 1
0
        public async Task <IActionResult> GetLate(int patrolId)
        {
            //ensure the entry belongs to the current user and that the current user is still in the specified patrol
            if (User.PatrolIds().Any(x => x == patrolId)) //or the user is an admin
            {
                var activeEntries = await _timeEntryRepository.GetMissingTimeEntries(patrolId, _clock.UtcNow.UtcDateTime);

                return(Ok(activeEntries));
            }
            else
            {
                return(Forbid());
            }
        }