es ist möglich beim Gerücht positiv Werte zu buchen #29

Closed
opened 2023-04-11 16:13:03 +00:00 by drenz · 2 comments
Member

wenn man im Preiseingabefeld einen negativ Betrag eingibt und als Button speichert, erscheint der als positiv Button und kann genutzt werden, um sich Guthaben zu verschaffen

wenn man im Preiseingabefeld einen negativ Betrag eingibt und als Button speichert, erscheint der als positiv Button und kann genutzt werden, um sich Guthaben zu verschaffen
drenz added the
🐞 bug
label 2023-04-11 16:13:03 +00:00
Owner

Fixed in commit db4f3c45c40d3d41149665814a018514aecccd9e for frontend.
Have to validate if necessary in backend.

Fixed in commit db4f3c45c40d3d41149665814a018514aecccd9e for frontend. Have to validate if necessary in backend.
crimsen added the
📺 frontend
label 2023-05-03 11:19:36 +00:00
Owner
    elif (
        amount < 0
        and (
            (user == current_session.user_ and user.has_permission(permissions.DEBIT_OWN))
            or current_session.user_.has_permission(permissions.DEBIT)
        )
    ) or (amount > 0 and current_session.user_.has_permission(permissions.CREDIT)):
        return HTTP.created(balance_controller.change_balance(user, data["amount"], current_session.user_))

    raise Forbidden

in backend it was already implemented. The failure that you can amount the value as credit is, that the user has the correct permission to do that.

```python elif ( amount < 0 and ( (user == current_session.user_ and user.has_permission(permissions.DEBIT_OWN)) or current_session.user_.has_permission(permissions.DEBIT) ) ) or (amount > 0 and current_session.user_.has_permission(permissions.CREDIT)): return HTTP.created(balance_controller.change_balance(user, data["amount"], current_session.user_)) raise Forbidden ``` in backend it was already implemented. The failure that you can amount the value as credit is, that the user has the correct permission to do that.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Flaschengeist/flaschengeist#29
No description provided.