Workaround for doc read only() strangeness
From AdeptersWiki
Submitted by: Karl Johan Kleist
Last Updated: 2008-09-22
Problem
The ACL function doc_read_only() does not return 1 as expected when a file which is read-only on the file system has been opened. The online docs is somewhat unclear about whether this is by design or not. (This is 5.2 M030.)
Workaround
Tung Fu (PTC) has given some clues, which have led me to the following workaround:
function better_doc_read_only() {
return (oid_find_valid_insert(oid_root()) == oid_null()) ? 1 : 0;
}
Works for me. Let the buyer beware.