The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/views/account/sidebarItems.ts

46 lines
1.3 KiB

import { hasPermission, hasAtLeastOnePermission } from '../../../app/authorization/client';
import { settings } from '../../../app/settings/client';
import { createSidebarItems } from '../../lib/createSidebarItems';
export const {
registerSidebarItem: registerAccountSidebarItem,
unregisterSidebarItem,
getSidebarItems: getAccountSidebarItems,
subscribeToSidebarItems: subscribeToAccountSidebarItems,
} = createSidebarItems([
{
href: 'preferences',
i18nLabel: 'Preferences',
icon: 'customize',
},
{
href: 'profile',
i18nLabel: 'Profile',
icon: 'user',
permissionGranted: (): boolean => settings.get('Accounts_AllowUserProfileChange'),
},
{
href: 'security',
i18nLabel: 'Security',
icon: 'lock',
permissionGranted: (): boolean => settings.get('Accounts_TwoFactorAuthentication_Enabled') || settings.get('E2E_Enable'),
},
{
href: 'integrations',
i18nLabel: 'Integrations',
icon: 'code',
permissionGranted: (): boolean => settings.get('Webdav_Integration_Enabled'),
},
{
href: 'tokens',
i18nLabel: 'Personal_Access_Tokens',
icon: 'key',
permissionGranted: (): boolean => hasPermission('create-personal-access-tokens'),
},
{
href: 'omnichannel',
i18nLabel: 'Omnichannel',
icon: 'headset',
permissionGranted: (): boolean => hasAtLeastOnePermission(['send-omnichannel-chat-transcript', 'request-pdf-transcript']),
},
]);