Legislature approves ban of open carry of guns at demonstrations, state Capitol