• Resolved foriaa

    (@foriaa)


    I discovered that the docs created in backend are not visible to not logged users.
    I checked permission and meta datas but everything looks fine.
    Do you know what could be the problem?
    Thx

    The page I need help with: [log in to see the link]

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

    (@dcavins)

    Hi @foriaa-

    Yes, docs created via the backend (wp-admin area) are not reliably given the correct access permissions. It’s really best to use the front end to create new docs, because we’re doing some special logic to set them up correctly.

    Best,

    -David

    Thread Starter foriaa

    (@foriaa)

    Hi @dcavins
    Thanks for replying me.
    Is there any way possible to give the right permissions? Because I inserted many articles now and I don’t want to insert them again 1 by 1 from front-end.
    I checked a solution from DB and PhpMyAdmin but I didn’t figure out what is the table/value.
    In case there is a solution by DB, I will run a query adding the meta value to that posts.
    Thx

    Plugin Author David Cavins

    (@dcavins)

    Hi @foriaa-

    The best way to apply the access settings in your case is to use the BP Docs function bp_docs_save_doc_access_settings(). Here’s a rough example of some php code that would loop through a list of doc IDs and apply the same settings to each doc.

    $settings = array(
    	'read' => 'anyone',
    	'edit' => 'loggedin',
    	'read_comments' => 'anyone',
    	'post_comments' => 'loggedin',
    	'view_history' => 'loggedin',
    	'manage' => 'creator'
    );
    
    $doc_ids = array( 13, 17, 21 );
    $author_id = 1; // Set to the user you used to create all the docs.
     
    foreach ( $doc_ids as $doc_id ) {
    	bp_docs_save_doc_access_settings( $doc_id, $author_id, $settings );
    }

    -David

    Thread Starter foriaa

    (@foriaa)

    @dcavins thx a lot. this saved me a lot of time.

    • This reply was modified 7 years ago by foriaa.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Docs inserted by back-end are not visible’ is closed to new replies.