Unverified Commit e2c89a94 authored by Bowen Liang's avatar Bowen Liang Committed by GitHub

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

parent 869690c4
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment