Beispiel #1
0
        public async Task <ActionResult> ExpireAssignment(int id, string expiryReason, DateTimeOffset?expiryDate = null)
        {
            var savedAssignment = await AssignmentService.GetAssignment(id);

            if (savedAssignment == null)
            {
                return(NotFound());
            }
            if (!PermissionDataFiltersExtensions.HasAccessToLocation(User, Db, savedAssignment.LocationId))
            {
                return(Forbid());
            }

            await AssignmentService.ExpireAssignment(id, expiryReason, expiryDate);

            return(NoContent());
        }