BOSTON (AP) _ Massachusetts' highest court says the state's Department of Correction overstepped its authority when it began using dogs to search prison visitors for drugs without giving the public a chance to weigh in.

The Supreme Judicial Court ruled Thursday that the department should have followed a regulatory process that allows interested parties an opportunity to present their views.

The drug-dog policy has been in place since 2013. The court said it could have a ``potentially significant impact'' on visitors' experience.

The court is allowing the department to continue using the dogs for a certain period while it follows the proper regulatory process.

Prisons officials say the dogs are necessary to cut down on illegal contraband behind bars, but prisoner advocates say the searches could discourage visitation.

More From WBSM-AM/AM 1420