Handle permission changes.

Issue #71
File lock issues are still a problem. Edit a locked document and it
never becomes readable again.
Changed user_id to be an int in a couple of places.
Messaging the user to let them know their permissions changed.
Added "set" support.