Merge pull request 'Disable users on items for now' (#2) from feature/users into main

Reviewed-on: #2
This commit is contained in:
Kasper Juul Hermansen 2021-11-18 23:07:18 +01:00
commit 6c161843e5
4 changed files with 6 additions and 19 deletions

View File

@ -1,17 +0,0 @@
kind: pipeline
name: default
steps:
- name: apply ansible production
image: plugins/ansible:latest
settings:
playbook: deployment/todo-setup.yml
inventory: deployment/prod/hosts
galaxy: deployment/requirements.yml
private_key:
from_secret: ansible_private_key
verbose: 3
when:
event:
- push

View File

@ -24,8 +24,8 @@ public record GetTodoByIdQuery([Required] string TodoId) : IRequest<TodoViewMode
var userId = _currentUserService.GetUserId();
var todo = await _todoRepository.GetTodoByIdAsync(request.TodoId);
if (todo.AuthorId != userId)
throw new InvalidOperationException("User is not allowed to access todo");
//if (todo.AuthorId != userId)
// throw new InvalidOperationException("User is not allowed to access todo");
return TodoViewModel.From(todo);
}

View File

@ -40,6 +40,9 @@ export const TodoItem: FC<TodoItemProps> = (props) => {
{props.todo.description && (
<div className="h-3 w-3 bg-gray-100 dark:border-black border border-gray-300 dark:bg-gray-900 rounded-sm" />
)}
{!props.todo.authorId && (
<div className="h-3 w-3 bg-red-500 rounded-sm" />
)}
</div>
{props.displayProject && props.todo.project && (
<div className="text-gray-500 text-xs text-right whitespace-nowrap place-self-end">

View File

@ -12,6 +12,7 @@ export interface Todo {
description?: string;
status: StatusState;
project?: string;
authorId?: string;
}
export const asTodo = (item: Todo): Todo => {