From b949b936ca3eb4ca998f6752ce72e7a8fbfeca73 Mon Sep 17 00:00:00 2001 From: andrewwallacespeckle Date: Wed, 19 Mar 2025 23:07:33 +0000 Subject: [PATCH] Add comment --- .../settings/workspaces/members/UpdateActionsMenu.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/frontend-2/components/settings/workspaces/members/UpdateActionsMenu.vue b/packages/frontend-2/components/settings/workspaces/members/UpdateActionsMenu.vue index ab8bafcd7..08a1c222e 100644 --- a/packages/frontend-2/components/settings/workspaces/members/UpdateActionsMenu.vue +++ b/packages/frontend-2/components/settings/workspaces/members/UpdateActionsMenu.vue @@ -74,6 +74,12 @@ const filteredActionsItems = computed(() => { const mainItems: LayoutMenuItem[] = [] const footerItems: LayoutMenuItem[] = [] + // Iterate through all possible actions and filter them based on: + // 1. If the current user is an admin (for permission-based actions) + // 2. If the action is being performed on the current user (for self-actions like "Leave") + // 3. The target user's current role (to show/hide role change options) + // 4. The target user's seat type (to show relevant upgrade/downgrade options) + // Special case: For remove action, we check against 'canRemove' instead of actual role Object.entries(UpdateWorkspaceMemberConfig).forEach(([type, config]) => { if ( config.menu.show({