-- Permissões RBAC para API Pública

INSERT IGNORE INTO permissions (name, description, category) VALUES
('api.read', 'Acessar API pública', 'api'),
('api.manage', 'Gerenciar API e webhooks', 'api');

-- Adicionar permissões ao role admin
INSERT IGNORE INTO role_permissions (role_id, permission_id)
SELECT r.id, p.id
FROM roles r
CROSS JOIN permissions p
WHERE r.name = 'admin' AND p.name LIKE 'api.%';

