Description
When a company card feed is shared to a non-preferred workspace via linkedPolicyIDs, the "Assign card" button is greyed out (disabled) even though the admin should be able to assign cards on that workspace.
Root cause: useIsAllowedToIssueCompanyCard.ts checks if selectedFeedData.domainID === policy.workspaceAccountID to decide whether policy admin status is sufficient. For shared feeds, the domainID belongs to the owning workspace, not the current one — so the check fails and falls through to a domain admin check, which also fails for users who are only workspace admins.
Expected: Policy admins on any workspace that has the feed via linkedPolicyIDs should be able to assign cards.
Actual: Assign button is disabled on non-preferred workspaces because the permission check doesn't account for linkedPolicyIDs.
Related internal issue: https://github.com/Expensify/Expensify/issues/631473
Description
When a company card feed is shared to a non-preferred workspace via
linkedPolicyIDs, the "Assign card" button is greyed out (disabled) even though the admin should be able to assign cards on that workspace.Root cause:
useIsAllowedToIssueCompanyCard.tschecks ifselectedFeedData.domainID === policy.workspaceAccountIDto decide whether policy admin status is sufficient. For shared feeds, thedomainIDbelongs to the owning workspace, not the current one — so the check fails and falls through to a domain admin check, which also fails for users who are only workspace admins.Expected: Policy admins on any workspace that has the feed via
linkedPolicyIDsshould be able to assign cards.Actual: Assign button is disabled on non-preferred workspaces because the permission check doesn't account for
linkedPolicyIDs.Related internal issue: https://github.com/Expensify/Expensify/issues/631473