• I see that admins can always edit docs, even when the edit access setting is set to ‘creator’ on upload.

    Is it possible to also give moderators the same capability?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author David Cavins

    (@dcavins)

    Hi @carolineelisa-

    A filter like this should work:

    function dc_custom_groups_mods_can_edit( $user_can, $action, $user_id, $doc_id = false ) {
    		$group_id = bp_get_current_group_id();
    		if ( ! $group_id && ! empty( $doc_id ) ) {
    			$group_id = bp_docs_get_associated_group_id( $doc_id );
    		}
    		if ( ! $group_id ) {
    			return $user_can;
    		}
    
    		if ( groups_is_user_admin( $user_id, $group_id ) || groups_is_user_mod( $user_id, $group_id ) ) {
    			$user_can = true;
    		}
    		return $user_can;
    }
    add_filter( 'bp_docs_user_can', 'dc_custom_groups_mods_can_edit', 10, 4 );

    It allows group mods and admins to basically do anything with group-associated docs.

Viewing 1 replies (of 1 total)

The topic ‘Allow mods to edit group docs?’ is closed to new replies.