Hi pezflash-
There are a variety of plugins and approaches to make access to anything on a WP site private. Search the web for “BuddyPress Private Community” and you’ll see several ways to get there.
That’s definitely not the intention of this plugin though, which allows a doc settings to allow reading by “anyone” vs “logged-in users”. So users are given the choice of how public a doc should be on a per-doc basis.
Hi David, thanks for the great plugin!
Two questions, also related to keeping docs private:
1) New documents are always set to public, could you add an option in the plugin settings to change this?
2) We have a lot of docs where we want to change the policy. Could the access settings also be changed via the bulk edit function in the dashboard? Or, as an ad-hoc solution, can you tell me how to do this with an SQL query on the database directly? Which fields store the Access information of each doc?
Thanks!
Hi m4lvin-
Re 1) Yes, you can change the defaults using the bp_docs_get_access_options filter. Use a low priority to make sure your function fires after the other parts of BP Docs have run.
Re 2) Yes, you could do a bulk update. Doc access is controlled by a combination of things (this is where it gets tricky). First, there’s a serialized post_meta, bp_docs_settings, associated with a doc that might be:
a:5:{s:4:"read";s:13:"group-members";s:4:"edit";s:13:"group-members";s:13:"read_comments";s:11:"admins-mods";s:13:"post_comments";s:11:"admins-mods";s:12:"view_history";s:7:"creator";}
And there are two taxonomies that help with making the access protection queries more efficient:
bp_docs_access are terms like bp_docs_access_anyone
bp_docs_associated_item are terms like bp_docs_associated_group_5
You’ll have to look at existing docs and see what settings you’re trying to achieve. Best of luck!