feat: add DISC profiles and a sales copilot as an org module
Help reps capture a customer's likely behavior style and get negotiation guidance, with the feature gated from super admin. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import type { AuthUserDto } from '@mento/shared';
|
||||
|
||||
export function canUseBehavior(user: AuthUserDto | null | undefined): boolean {
|
||||
if (!user) return false;
|
||||
const modules = user.enabledModules;
|
||||
if (modules && !modules.includes('behavior')) return false;
|
||||
if (user.role === 'owner' || user.role === 'admin') return true;
|
||||
const permissions = user.permissions ?? [];
|
||||
return permissions.includes('behavior') || permissions.includes('sales');
|
||||
}
|
||||
Reference in New Issue
Block a user