Encrypt or decrypt using the private key, and decrypt using the public key?
What you want is called a signature scheme. This will enforce the separation concerning the right to write. If you need confidentiality as well, you can combine this with traditional symmetric or public-key encryption.

So how does this work with signatures? Whenever somebody from Group B writes the data, they remove the old signature and apply a new one. Now anybody from Group A or B can verify that the file has not been modified since it was last edited (by a member of group B). Of course, members from group A won't be able to sign the file, because their public signature keys won't be added to the central list of trusted signature keys. Alternatively one could also use something called a ring signature which also guarantees anonymity of the original writer (or a group signature if attributation is wanted).