FRANKFORT, Ky. (AP) — When Kentucky's legislature is not in session, the governor can shuffle the membership of state boards and commissions but he can't give those members new jobs, according to a judge's ruling as part of an ongoing dispute with two of the state's top elected officials.

Judge Thomas Wingate ruled partially for and against both Republican Gov. Matt Bevin and Democratic Attorney General Andy Beshear, who have been tangled in court for more than a year in four separate lawsuits Beshear has filed challenging some of the governor's executive actions. The lawsuits have been tinged with politics as Beshear is a potential candidate for governor in 2019 when Bevin could run for re-election.

For Bevin, the ruling means he can still use a state law to shuffle the membership of boards and commissions when the legislature is not in session, something he has done at least 37 times since taking office. For Beshear, it means Bevin's order establishing a new process for teachers to appeal disciplinary actions and certification decisions is unconstitutional.

Bevin spokeswoman Amanda Stamper said the office was pleased with the ruling. She said the governor's office respects Wingate's decision to strike down the new teacher appellate procedure, adding she expects the legislature to address that issue next year.

"The Court shot down Attorney General Beshear's politically motivated arguments that he has repeatedly raised over the last two years," Stamper said.

Beshear called the ruling a victory for teachers and families because he said the court blocked Bevin's attempt to "control and change the certification and disciplinary process for Kentucky's school teachers." A spokesman said Beshear's office is still analyzing the order, but believes it is likely "at least one of the parties will appeal."

"I believe the Kentucky Supreme Court will find the governor broke more laws when this matter is appealed. The governor simply cannot rewrite law through executive order," Beshear said in a news release.

Most importantly for the governor's office, the ruling upholds their interpretation of state law giving the governor authority to change boards and commissions that regulate government services and oversee some of the state's largest industries. Three of Beshear's four lawsuits against Bevin have been over orders changing membership of state boards, including the Kentucky Employees Retirement System and the board of trustees at the University of Louisville.

Wingate ruled it is legal for Bevin to make those changes because the changes are not permanent. The state legislature must review the changes when it meets each year. If lawmakers don't approve the changes, they expire.

"The governor does not have the ability to make any permanent changes to the Kentucky statutory scheme," Wingate wrote.

But Wingate said Bevin's order did go too far when he changed the process for public school teachers to appeal disciplinary actions and certification decisions handed down by the Education Professional Standards Board. Before the order, teachers could appeal rulings directly to the circuit court. But Bevin's order said teachers had to appeal to the state Board of Education first, then the court system.

Wingate said Bevin's order amounted to a new law.

"The governor, in his delegated authority by (state law) does not have the power to create new laws, which violates the Kentucky Constitution," Wingate wrote.