Support » Plugin: BuddyPress Docs » Group Admin Permission

  • Resolved popimpag

    (@popimpag)


    I would like to make every doc accessible to super admins AND admins of group when a member of the group uploads a doc. How can I accomplish this?
    Thank you very much in advance.

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

    (@dcavins)

    Hi @popimpag,

    The way I’d do this is by filtering the access levels so that group-associated docs cannot be given the “creator only” access level. This filter accomplishes that: https://gist.github.com/dcavins/0d4750c54847afd1d92fa34e34539f45

    You can put that code in your functions.php file or your bp-custom.php file, which you can read more about here: https://codex.buddypress.org/themes/bp-custom-php/

    Thread Starter popimpag

    (@popimpag)

    Hi @dcavins and thank you for your reply.
    I want to use this in groups with teacher (creator of group) and students (members) I want for some docs the access to be granted for the one that uploaded it if he/she wishes to edit it and for the teacher who created the group. For this kind of docs I do not want the other simple members to have access.
    I need access for user, group administrators and super admins

    I tried this

    https://wordpress.org/support/topic/allow-mods-to-edit-group-docs/

    in /plugins/bp-custom.php and in functions.php but my group administrator still doesn’t have access

    Thank you very much in advance

    Calliope

    Plugin Author David Cavins

    (@dcavins)

    Hi @popimpag,

    I’m sorry, but I don’t think there is a simple way to achieve your specific use case, which if I understand correctly, is to make group-associated documents that only the creator and group admin/mods can read or edit. The complication is that because of the way WP_Query works, we have to exclude all of the docs that a user shouldn’t see from Docs queries. So, if a user chooses “only me” for the doc access levels, the doc is given a taxonomy term that prevents everyone else from seeing it. To show the docs you want to include, the query would have to include docs that are group-associated no matter what, but the exclusion takes precedence.

    I believe you would have to create a whole new access level, and the logic that protects those docs, so that the exclusion is less iron-clad, which is beyond the scope of a support request.

    Best,

    -David

    Plugin Author David Cavins

    (@dcavins)

    @popimpag I also wanted to say how great it was of you to look through earlier support requests to see if your issue had been answered previously.

    Here’s an updated version of the permissions change from the ticket you linked to. We’ve switched to using the core WP capabilities logic for most things, and this gist uses the new plumbing: https://gist.github.com/dcavins/da1f817d4ebb319af073587c727bf6ab

    The change is only partially helpful, though, as I note in the comments:

    * Allow group admins and mods to read and edit any BP Doc 
     * associated with a group they moderate.
     * Note: this will allow direct access at <code>/docs/doc-title/</code> but
     * the docs will not be listed in the group docs directory if the 
     * access level "should" prevent the user from accessing it. 
     * So it's of limited usefulness.
    Thread Starter popimpag

    (@popimpag)

    Thank you very much @dcavins for your replies and for all the support you gave me although it is a free plugin. You helped me a lot. It is really a great plugin. Have a nice day.

    Calliope

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