• Resolved redg1985

    (@redg1985)


    I am using the plugin and works great, however, by default when a user is crating a document visibility is “Anyone” and this is a problem as some users are posting documents with private date.

    So I would like to know if there is a way to have the option “The Doc author” only or at least, be the default option when creating a document.

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

    (@dcavins)

    Sure, you can add a filter that changes the default access options. Here’s an example: https://gist.github.com/dcavins/cb7db0b02cdbbdaa2efda46a32e3ef4d

    Code like this could go wherever you like to store your functionality code. If you don’t have any idea about this, then using bp-custom.php is a good option. https://codex.buddypress.org/themes/bp-custom-php/

    Thread Starter redg1985

    (@redg1985)

    Thank you so much, David! It worked!

    I have another question, also related to this.

    Is it possible to allow document creation ONLY for admins and not for users?

    What I would like to achieve is for admins to be able to upload the homework or important documents for the users, but prevent users from creating documents for themselves.

    Imagine, as a teacher, I need to send specific homework to User A and User B that could be totally different.

    So far, I haven’t found a way to create a document to be seen by a specific user only (if this exists, please let me know), so I am using group functionality for that.

    Therefore, I would like admins to be able to create any document (even with groups) but that users can only read what is assigned to themselves or their group (but not upload).

    Is that possible?

    Plugin Author David Cavins

    (@dcavins)

    Sure, you can restrict who can create new docs: https://gist.github.com/dcavins/71d1a9ee976be6336d67073ddeba5dc6

    Be aware that BP Docs was not designed for your situation, so there may be another solution that more closely fits your needs, like one of the learning management system plugins for WP/BP.

    Thread Starter redg1985

    (@redg1985)

    Thanks, David! Worked perfectly again!!

    Yes, I am using another plugin for LMS (classes, videos, homework, etc.), but maybe I didn’t explain myself clearly in this case.

    I wanted the document functionality of BuddyDocs to be used as a repository. For example, for a document that you don’t want to have to search through your email 2 years later, but you want to have it readily available when you want.

    So, if an Admin could create a document and select “User A” or “User B” as viewers from the dropdown, that would be great.

    But this is not possible, right?


    Plugin Author David Cavins

    (@dcavins)

    Correct, that is not possible in the plugin. It’s also not feasible (we’ve wanted to add that functionality so have looked into it), because the docs protection query is an exclusion query, and, if you have a decently large site like 1000 members, the query grows out of control.

    Thread Starter redg1985

    (@redg1985)

    Make sense 🙂 Thanks a lot!!

    Thread Starter redg1985

    (@redg1985)

    Hi! one more question 🙂

    As you said, is possible to restrict who can create new docs: https://gist.github.com/dcavins/71d1a9ee976be6336d67073ddeba5dc6

    But then, how can I restrict the user to see the tab “Docs” in their profile?

    As now I would like them only to see “Group Docs” instead, cause “Docs” will be empty as they cannot upload.

    Is possible?

    • This reply was modified 2 months, 4 weeks ago by redg1985.
    Plugin Author David Cavins

    (@dcavins)

    Sure, you can change the user’s navigation menu using BuddyPress’s nav menu API: https://codex.buddypress.org/developer/navigation-api/

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