extract enum type for tenant account role (#3788)
This commit is contained in:
parent
cde87cb225
commit
c54fcfb45d
6 changed files with 36 additions and 12 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue