This is very similar to:
http://stackoverflow.com/questions/1681058/vim-auto-commands-writing-a-read-only-file
Except that in addition to the solution presented there, I want vim to only ask for confirmation if the file is still read-only.
In other words, if I do :w, I do not want vim to say that the file is read-only. It should automatically open the file for edit using perforce, and only if the file is still read-only should it then ask for confirmation.