Hi a.r.7-
Similar to my other answer, if I look in templates/single/docs/edit.php for the section that outputs the “parent doc” form field, I find this line:
apply_filters( 'bp_docs_allow_parent_doc_setting', true, $doc_id )
The following code filters that value, allowing contributors and up to use the parent field, excluding subscriber-level users:
add_filter( 'bp_docs_allow_parent_doc_setting', 'my_bpd_disallow_parent_field' );
function my_bpd_disallow_parent_field( $retval ) {
if ( ! current_user_can( 'edit_posts' ) ) {
$retval = false;
}
return $retval;
}
See https://codex.wordpress.org/Roles_and_Capabilities to see how I chose the capability to check.
Thread Starter
Achim
(@ar7)
This works fine for me, THANK YOU.
(In my eyes the best way would be, if everybody could only choose a doc as parent, if he is allowed to edit that doc. Would that be very complicated to implement?)