fix: bypass admin users to use dataset api with API key (#2072)

This commit is contained in:
Bowen Liang 2024-01-19 17:23:05 +08:00 committed by GitHub
parent 869690c485
commit e2c89a9487
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,7 +75,7 @@ def validate_dataset_token(view=None):
tenant_account_join = db.session.query(Tenant, TenantAccountJoin) \
.filter(Tenant.id == api_token.tenant_id) \
.filter(TenantAccountJoin.tenant_id == Tenant.id) \
.filter(TenantAccountJoin.role == 'owner') \
.filter(TenantAccountJoin.role.in_(['owner', 'admin'])) \
.one_or_none()
if tenant_account_join:
tenant, ta = tenant_account_join