Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Code scanning - action / CodeQL-Build (push) Failing after 2s
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
163 lines
4.3 KiB
TypeScript
163 lines
4.3 KiB
TypeScript
import { defaultFeaturesPreview } from '@rocket.chat/ui-client';
|
|
|
|
import { hasPermission, hasAtLeastOnePermission, hasAllPermission } from '../../lib/authorization';
|
|
import { createSidebarItems } from '../../lib/createSidebarItems';
|
|
|
|
export const {
|
|
registerSidebarItem: registerAdminSidebarItem,
|
|
unregisterSidebarItem,
|
|
getSidebarItems: getAdminSidebarItems,
|
|
subscribeToSidebarItems: subscribeToAdminSidebarItems,
|
|
} = createSidebarItems([
|
|
{
|
|
href: '/admin/info',
|
|
i18nLabel: 'Workspace',
|
|
icon: 'info-circled',
|
|
permissionGranted: (): boolean => hasPermission('view-statistics'),
|
|
},
|
|
{
|
|
href: '/admin/subscription',
|
|
i18nLabel: 'Subscription',
|
|
icon: 'card',
|
|
permissionGranted: (): boolean => hasPermission('manage-cloud'),
|
|
},
|
|
{
|
|
href: '/admin/engagement/users',
|
|
i18nLabel: 'Engagement',
|
|
icon: 'dashboard',
|
|
permissionGranted: (): boolean => hasPermission('view-engagement-dashboard'),
|
|
},
|
|
{
|
|
href: '/admin/moderation',
|
|
i18nLabel: 'Moderation',
|
|
icon: 'shield-alt',
|
|
tag: 'Beta',
|
|
permissionGranted: (): boolean => hasPermission('view-moderation-console'),
|
|
},
|
|
{
|
|
href: '/admin/rooms',
|
|
i18nLabel: 'Rooms',
|
|
icon: 'hashtag',
|
|
permissionGranted: (): boolean => hasPermission('view-room-administration'),
|
|
},
|
|
{
|
|
href: '/admin/users',
|
|
i18nLabel: 'Users',
|
|
icon: 'team',
|
|
permissionGranted: (): boolean => hasPermission('view-user-administration'),
|
|
},
|
|
{
|
|
href: '/admin/ai-center',
|
|
i18nLabel: 'AI_Center',
|
|
icon: 'stars',
|
|
tag: 'Beta',
|
|
permissionGranted: (): boolean =>
|
|
hasAtLeastOnePermission(['view-privileged-setting', 'edit-privileged-setting', 'manage-selected-settings']),
|
|
},
|
|
{
|
|
href: '/admin/invites',
|
|
i18nLabel: 'Invites',
|
|
icon: 'user-plus',
|
|
permissionGranted: (): boolean => hasPermission('create-invite-links'),
|
|
},
|
|
{
|
|
href: '/admin/user-status',
|
|
i18nLabel: 'User_Status',
|
|
icon: 'user',
|
|
permissionGranted: (): boolean => hasAtLeastOnePermission(['manage-user-status']),
|
|
},
|
|
{
|
|
href: '/admin/permissions',
|
|
i18nLabel: 'Permissions',
|
|
icon: 'user-lock',
|
|
permissionGranted: (): boolean => hasAtLeastOnePermission(['access-permissions', 'access-setting-permissions']),
|
|
},
|
|
{
|
|
href: '/admin/ABAC',
|
|
i18nLabel: 'ABAC',
|
|
icon: 'team-lock',
|
|
permissionGranted: (): boolean =>
|
|
hasPermission('abac-management') &&
|
|
hasAtLeastOnePermission([
|
|
'manage-abac-admin-settings',
|
|
'manage-abac-admin-room-attributes',
|
|
'manage-abac-admin-rooms',
|
|
'view-abac-admin-audit',
|
|
]),
|
|
},
|
|
{
|
|
href: '/admin/device-management',
|
|
i18nLabel: 'Device_Management',
|
|
icon: 'mobile',
|
|
permissionGranted: (): boolean => hasPermission('view-device-management'),
|
|
},
|
|
{
|
|
href: '/admin/email-inboxes',
|
|
i18nLabel: 'Email_Inboxes',
|
|
icon: 'mail',
|
|
tag: 'Alpha',
|
|
permissionGranted: (): boolean => hasPermission('manage-email-inbox'),
|
|
},
|
|
{
|
|
href: '/admin/mailer',
|
|
icon: 'mail',
|
|
i18nLabel: 'Mailer',
|
|
permissionGranted: (): boolean => hasAllPermission('access-mailer'),
|
|
},
|
|
{
|
|
href: '/admin/third-party-login',
|
|
i18nLabel: 'Third_party_login',
|
|
icon: 'login',
|
|
permissionGranted: (): boolean => hasAllPermission('manage-oauth-apps'),
|
|
},
|
|
{
|
|
href: '/admin/integrations',
|
|
i18nLabel: 'Integrations',
|
|
icon: 'code',
|
|
permissionGranted: (): boolean =>
|
|
hasAtLeastOnePermission([
|
|
'manage-outgoing-integrations',
|
|
'manage-own-outgoing-integrations',
|
|
'manage-incoming-integrations',
|
|
'manage-own-incoming-integrations',
|
|
]),
|
|
},
|
|
{
|
|
href: '/admin/import',
|
|
i18nLabel: 'Import',
|
|
icon: 'import',
|
|
permissionGranted: (): boolean => hasPermission('run-import'),
|
|
},
|
|
{
|
|
href: '/admin/analytic-reports',
|
|
i18nLabel: 'Reports',
|
|
icon: 'post',
|
|
permissionGranted: (): boolean => hasPermission('view-logs'),
|
|
},
|
|
{
|
|
href: '/admin/sounds',
|
|
i18nLabel: 'Sounds',
|
|
icon: 'volume',
|
|
permissionGranted: (): boolean => hasPermission('manage-sounds'),
|
|
},
|
|
{
|
|
href: '/admin/emoji',
|
|
i18nLabel: 'Emoji',
|
|
icon: 'emoji',
|
|
permissionGranted: (): boolean => hasPermission('manage-emoji'),
|
|
},
|
|
{
|
|
href: '/admin/feature-preview',
|
|
i18nLabel: 'Feature_preview',
|
|
icon: 'flask',
|
|
permissionGranted: () => defaultFeaturesPreview?.length > 0,
|
|
},
|
|
{
|
|
href: '/admin/settings',
|
|
i18nLabel: 'Settings',
|
|
icon: 'customize',
|
|
permissionGranted: (): boolean =>
|
|
hasAtLeastOnePermission(['view-privileged-setting', 'edit-privileged-setting', 'manage-selected-settings']),
|
|
},
|
|
]);
|