/**
 * Catálogo general — permisos `cat_notices.*` (`permissions_general` en seed_v2.py).
 * Avisos electrónicos
 */
import type { User } from '$lib/auth';
import { userHasPermission } from '$lib/auth';

export type ElectronicNoticesCatalogAction = 'view' | 'create' | 'edit' | 'delete';

export function userHasElectronicNoticesAction(user: User | null, action: ElectronicNoticesCatalogAction): boolean {
	return userHasPermission(user, `cat_notices.${action}`);
}
