Enforce tenant member permissions
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-16 13:33:36 +01:00
parent df60be826d
commit 7aa0a4c847
22 changed files with 592 additions and 112 deletions

View File

@@ -22,6 +22,7 @@ import { useAdminTheme } from './theme';
export default function MobileProfilePage() {
const { user, logout } = useAuth();
const isMember = user?.role === 'member';
const navigate = useNavigate();
const { t } = useTranslation('management');
const { appearance, updateAppearance } = useAppearance();
@@ -130,51 +131,55 @@ export default function MobileProfilePage() {
onPress={() => navigate(ADMIN_PROFILE_ACCOUNT_PATH)}
/>
</YGroup.Item>
<YGroup.Item>
<ListItem
hoverTheme
pressTheme
paddingVertical="$2"
paddingHorizontal="$3"
title={
<Text fontSize="$sm" color={textColor}>
{t('billing.sections.packages.title', 'Packages & Billing')}
</Text>
}
iconAfter={<Settings size={18} color={subtle} />}
onPress={() => navigate(adminPath('/mobile/billing#packages'))}
/>
</YGroup.Item>
<YGroup.Item>
<ListItem
hoverTheme
pressTheme
paddingVertical="$2"
paddingHorizontal="$3"
title={
<Text fontSize="$sm" color={textColor}>
{t('billing.sections.invoices.title', 'Invoices & Payments')}
</Text>
}
iconAfter={<Settings size={18} color={subtle} />}
onPress={() => navigate(adminPath('/mobile/billing#invoices'))}
/>
</YGroup.Item>
<YGroup.Item>
<ListItem
hoverTheme
pressTheme
paddingVertical="$2"
paddingHorizontal="$3"
title={
<Text fontSize="$sm" color={textColor}>
{t('dataExports.title', 'Data exports')}
</Text>
}
iconAfter={<Download size={18} color={subtle} />}
onPress={() => navigate(ADMIN_DATA_EXPORTS_PATH)}
/>
</YGroup.Item>
{!isMember ? (
<>
<YGroup.Item>
<ListItem
hoverTheme
pressTheme
paddingVertical="$2"
paddingHorizontal="$3"
title={
<Text fontSize="$sm" color={textColor}>
{t('billing.sections.packages.title', 'Packages & Billing')}
</Text>
}
iconAfter={<Settings size={18} color={subtle} />}
onPress={() => navigate(adminPath('/mobile/billing#packages'))}
/>
</YGroup.Item>
<YGroup.Item>
<ListItem
hoverTheme
pressTheme
paddingVertical="$2"
paddingHorizontal="$3"
title={
<Text fontSize="$sm" color={textColor}>
{t('billing.sections.invoices.title', 'Invoices & Payments')}
</Text>
}
iconAfter={<Settings size={18} color={subtle} />}
onPress={() => navigate(adminPath('/mobile/billing#invoices'))}
/>
</YGroup.Item>
<YGroup.Item>
<ListItem
hoverTheme
pressTheme
paddingVertical="$2"
paddingHorizontal="$3"
title={
<Text fontSize="$sm" color={textColor}>
{t('dataExports.title', 'Data exports')}
</Text>
}
iconAfter={<Download size={18} color={subtle} />}
onPress={() => navigate(ADMIN_DATA_EXPORTS_PATH)}
/>
</YGroup.Item>
</>
) : null}
</YGroup>
</YStack>
</Card>