 		ON mdl.sis_id = gpm.sis_id
 		AND mdl.mod_idPai = gpm.mod_id
 		AND mdl.mod_situacao <> 3
+	INNER JOIN SYS_GrupoPermissao gpmF WITH(NOLOCK)
+		ON mdl.sis_id = gpmF.sis_id
+		AND mdl.mod_id = gpmF.mod_id
 	WHERE
 		gpm.mod_id = @mod_idPai AND gpm.sis_id = @sis_id AND
-		(grp_consultar = 1 OR grp_alterar = 1 OR grp_excluir = 1 OR grp_inserir = 1)
+		(gpmF.grp_consultar = 1 OR gpmF.grp_alterar = 1 OR gpmF.grp_excluir = 1 OR gpmF.grp_inserir = 1)
 		
 	-- Mudando mdulos de Manuteno de turmas para o mod_idPai novo
 

		ON mdl.sis_id = gpm.sis_id
		AND mdl.mod_idPai = gpm.mod_id
		AND mdl.mod_situacao <> 3
	WHERE
		gpm.mod_id = @mod_idPai AND gpm.sis_id = @sis_id AND
		(grp_consultar = 1 OR grp_alterar = 1 OR grp_excluir = 1 OR grp_inserir = 1)
		
-- Fechar transao     
SET XACT_ABORT OFF 

		ON mdl.sis_id = gpm.sis_id
		AND mdl.mod_idPai = gpm.mod_id
		AND mdl.mod_situacao <> 3
	INNER JOIN SYS_GrupoPermissao gpmF WITH(NOLOCK)
		ON mdl.sis_id = gpmF.sis_id
		AND mdl.mod_id = gpmF.mod_id
	WHERE
		gpm.mod_id = @mod_idPai AND gpm.sis_id = @sis_id AND
		(gpmF.grp_consultar = 1 OR gpmF.grp_alterar = 1 OR gpmF.grp_excluir = 1 OR gpmF.grp_inserir = 1)
		
	-- Mudando mdulos de Calendrio para o mod_idPai novo

