feat: agregar control de visibilidad del total tarifado
This commit is contained in:
+11
-10
@@ -12,16 +12,11 @@ import { supabase } from "@/lib/supabase";
|
||||
|
||||
const ALLOWED_DOMAIN = "gomezleemarketing.com";
|
||||
const GERARDO_EMAIL = "gmarrero@gomezleemarketing.com";
|
||||
const INTERNAL_PRICING_ALLOWED_EMAILS = [
|
||||
GERARDO_EMAIL,
|
||||
"areyes@gomezleemarketing.com",
|
||||
"iaracena@gomezleemarketing.com",
|
||||
];
|
||||
const DELETE_ALLOWED_EMAILS = [
|
||||
GERARDO_EMAIL,
|
||||
"areyes@gomezleemarketing.com",
|
||||
"iaracena@gomezleemarketing.com",
|
||||
];
|
||||
const JOSE_LEOPOLDO_EMAIL = "jgomez@gomezleemarketing.com";
|
||||
const ISAAC_EMAIL = "iaracena@gomezleemarketing.com";
|
||||
const INTERNAL_PRICING_ALLOWED_EMAILS = [GERARDO_EMAIL, ISAAC_EMAIL];
|
||||
const PRICING_SUMMARY_CONTROLLER_EMAILS = [GERARDO_EMAIL, JOSE_LEOPOLDO_EMAIL, ISAAC_EMAIL];
|
||||
const DELETE_ALLOWED_EMAILS = [GERARDO_EMAIL, "iaracena@gomezleemarketing.com"];
|
||||
|
||||
function isAllowedEmail(email: string | null | undefined): boolean {
|
||||
if (!email) return false;
|
||||
@@ -71,6 +66,7 @@ interface AuthContextValue {
|
||||
isGerardo: boolean;
|
||||
canDeleteProjects: boolean;
|
||||
canManageInternalPricing: boolean;
|
||||
canControlPricingSummary: boolean;
|
||||
loginWithGoogle: () => Promise<void>;
|
||||
logout: () => Promise<void>;
|
||||
}
|
||||
@@ -180,6 +176,10 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
() => DELETE_ALLOWED_EMAILS.includes(normalizedEmail),
|
||||
[normalizedEmail],
|
||||
);
|
||||
const canControlPricingSummary = useMemo(
|
||||
() => PRICING_SUMMARY_CONTROLLER_EMAILS.includes(normalizedEmail),
|
||||
[normalizedEmail],
|
||||
);
|
||||
|
||||
return (
|
||||
<AuthContext.Provider
|
||||
@@ -190,6 +190,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
isGerardo,
|
||||
canDeleteProjects,
|
||||
canManageInternalPricing,
|
||||
canControlPricingSummary,
|
||||
loginWithGoogle,
|
||||
logout,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user