mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 06:44:32 +00:00
fix: credit display and top up and other UI display if personal membe… (#8784)
## Summary Consolidate scattered role checks for credits, top-up, and subscribe buttons into centralized workspace permissions (canTopUp, canManageSubscription), ensuring "Add Credits" requires an active subscription, subscribe buttons only appear when needed, and team members see appropriately restricted billing UI. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8784-fix-credit-display-and-top-up-and-other-UI-display-if-personal-membe-3036d73d3650810fbc2de084f738943c) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -14,6 +14,7 @@ interface WorkspacePermissions {
|
||||
canLeaveWorkspace: boolean
|
||||
canAccessWorkspaceMenu: boolean
|
||||
canManageSubscription: boolean
|
||||
canTopUp: boolean
|
||||
}
|
||||
|
||||
/** UI configuration for workspace role */
|
||||
@@ -44,7 +45,8 @@ function getPermissions(
|
||||
canRemoveMembers: false,
|
||||
canLeaveWorkspace: false,
|
||||
canAccessWorkspaceMenu: false,
|
||||
canManageSubscription: true
|
||||
canManageSubscription: true,
|
||||
canTopUp: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +59,8 @@ function getPermissions(
|
||||
canRemoveMembers: true,
|
||||
canLeaveWorkspace: true,
|
||||
canAccessWorkspaceMenu: true,
|
||||
canManageSubscription: true
|
||||
canManageSubscription: true,
|
||||
canTopUp: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +73,8 @@ function getPermissions(
|
||||
canRemoveMembers: false,
|
||||
canLeaveWorkspace: true,
|
||||
canAccessWorkspaceMenu: true,
|
||||
canManageSubscription: false
|
||||
canManageSubscription: false,
|
||||
canTopUp: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user