feat: Integrações buttons only for the superadmin; the folder downloads in Arte recebida by default
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 3m7s
Build and deploy / Secret scan and release gate (push) Successful in 4s
Build and deploy / Publish images (push) Successful in 47s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-20 09:55:31 -03:00
parent c8857a5bf5
commit df30046027
6 changed files with 52 additions and 33 deletions

View File

@@ -90,7 +90,7 @@ def backup_status(c):
@router.post('/api/operator/backup/run')
def backup_now(user=Depends(can('manage'))):
def backup_now(user=Depends(can('integrations'))):
"""A backup now, outside the daily hour: the backup service, which alone
may read the whole database, starts it within a minute."""
with db.connect() as c:
@@ -271,7 +271,7 @@ def events(provider: Literal['tiny'] | None = None,
status: Literal['delivered','queued','failing'] | None = None,
event: Literal['payment_approved','production_started','correction_needed','ready','cancelled'] | None = None,
order: int | None = Query(default=None, ge=1), offset: int = Query(default=0, ge=0),
limit: int = Query(default=20, ge=1, le=100), user=Depends(can('manage'))):
limit: int = Query(default=20, ge=1, le=100), user=Depends(can('integrations'))):
"""The integration send log, newest first, filtered, by page with a total."""
clauses, params = [], []
if provider:
@@ -676,7 +676,7 @@ def tiny_status():
**tiny.TinyAuth().status()}
@router.post('/api/operator/tiny/connect')
def tiny_connect(user=Depends(can('manage'))):
def tiny_connect(user=Depends(can('integrations'))):
"""Start the one-time authorisation of this system in the client's Tiny."""
if not tiny.configured():
raise HTTPException(503, 'Tiny application is not configured')
@@ -684,7 +684,7 @@ def tiny_connect(user=Depends(can('manage'))):
return {'url': tiny.TinyAuth().authorize_url(user)}
@router.post('/api/operator/tiny/test')
def tiny_test(user=Depends(can('manage'))):
def tiny_test(user=Depends(can('integrations'))):
"""Read one order and one contact from Tiny. Creates nothing."""
if not tiny.configured():
raise HTTPException(503, 'Tiny application is not configured')
@@ -696,7 +696,7 @@ def tiny_test(user=Depends(can('manage'))):
return {'ok': all(v == 'ok' for v in results.values()), 'results': results}
@router.post('/api/operator/mercadopago/check')
def mercadopago_check(user=Depends(can('manage'))):
def mercadopago_check(user=Depends(can('integrations'))):
"""The Mercado Pago account behind the configured token; reads only."""
if payment.name != 'mercadopago':
raise HTTPException(409, 'Mercado Pago não está configurado')