Exemplo n.º 1
0
        public async Task <bool> Authorise(ReorderCardsCommand request, CancellationToken cancellationToken = default)
        {
            if (request.CardIds is null || !request.CardIds.Any())
            {
                return(true);
            }

            return(await _currentUserPermissionService.HasPermissionForCard(
                       request.CardIds.First(),
                       BoardUserPermission.CAN_EDIT_CARD,
                       cancellationToken));
        }
 public async Task <bool> Authorise(MoveActivityToCardCommand request, CancellationToken cancellationToken = default)
 {
     return(await _currentUserPermissionService.HasPermissionForCard(request.CardId, BoardUserPermission.CAN_EDIT_CARD, cancellationToken) &&
            await _currentUserPermissionService.HasPermissionForActivity(request.ActivityId, BoardUserPermission.CAN_EDIT_ACTIVITY, cancellationToken));
 }
Exemplo n.º 3
0
 public async Task <bool> Authorise(DeleteCardCommand request, CancellationToken cancellationToken = default)
 {
     return(await _currentUserPermissionService.HasPermissionForCard(request.CardId, BoardUserPermission.CAN_DELETE_CARD, cancellationToken));
 }
Exemplo n.º 4
0
 public async Task <bool> Authorise(AddActivityToCardCommand request, CancellationToken cancellationToken = default)
 {
     return(await _currentUserPermissionService.HasPermissionForCard(request.CardId, BoardUserPermission.CAN_CREATE_ACTIVITY, cancellationToken));
 }