Police have been given extra powers in some parts of Wales to disperse crowds that build up.