Skip to:

can't upload media in bbpress

  • wenlujon


    I enabled the “add media” button in bbpress through bbpress-enable-tinymce-visual-tab plugin(by enabling “Fancy editor media upload”), and i can see the button in the forum, however i got error when trying to upload a picture:
    “You don’t have permission to attach files to this post.”

    the site role is Author while the forum role is Participant.

    I can add media if in wordpress, and I can also add media if the user is changed from participant to Keymaster.

    the code is in ajax-actions.php, however, if i remove it i got “HTTP error.”

            if ( isset( $_REQUEST['post_id'] ) ) {
                    $post_id = $_REQUEST['post_id'];
                    if ( ! current_user_can( 'edit_post', $post_id ) ) {
                            echo wp_json_encode( array(
                                    'success' => false,
                                    'data'    => array(
                                            'message'  => __( "You don't have permission to attach files to this post." ),
                                            'filename' => $_FILES['async-upload']['name'],
                            ) );
Viewing 3 replies - 1 through 3 (of 3 total)

  • wenlujon


    and i just found if enabling edit_others_forums for the user, then the user can add media, but it seems make no sense. (and there’s “Edit” link at the bottom of the forum). why is that?



    Jon Fergus


    Solution for me was to allow edit_others_topics and upload_files for the user role. As far as I can tell, checking this allows them to upload inline images in their comments but doesn’t let them actually edit the topics of others, oddly enough. So the solution seems to work without any additional problems being created by the extra permission.

    Note: I’m also using the adminimize plugin to hide dashboard options for lower user roles, which keeps them from seeing the topics menu or anything else in the backend, so there’s no worry about them having increased permissions so long as they’re stuck only editing/commenting from the front end.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar