extract enum type for tenant account role (#3788)
This commit is contained in:
@@ -3,7 +3,7 @@ import os
|
||||
import requests
|
||||
|
||||
from extensions.ext_database import db
|
||||
from models.account import TenantAccountJoin
|
||||
from models.account import TenantAccountJoin, TenantAccountRole
|
||||
|
||||
|
||||
class BillingService:
|
||||
@@ -74,5 +74,5 @@ class BillingService:
|
||||
TenantAccountJoin.account_id == current_user.id
|
||||
).first()
|
||||
|
||||
if join.role not in ['owner', 'admin']:
|
||||
if TenantAccountRole.is_privileged_role(join.role):
|
||||
raise ValueError('Only team owner or team admin can perform this action')
|
||||
|
Reference in New Issue
Block a user