예제 #1
0
파일: Handler.cs 프로젝트: yotamss/Tomorrow
        private async Task CheckAuthorizationAsync(Todo todo, CancellationToken cancellationToken)
        {
            var currentAccount = await accountProvider.GetCurrentAsync(cancellationToken);

            if (!todo.CanEdit(currentAccount))
            {
                throw new UnauthorizedRequestException("Todo can only be renamed by its owner or editors");
            }
        }