Blogs MU - modderators cant create group

I have yes selected and saved for "Do you want to allowed only admin and moderators to create group?"
in the theme's options, under buddypress

but when I try with a mod account it redirects me to index.php.. Is there a fix for this? or which is the file where this is defined as I will just correct it but cant seem to find it, also I might want to add diff user roles to it aswell so knowing the location would be best.

Regards

My install wp 3.0
bp 1.2.5.2

  • Nit3watch
    • Design Lord, Child of Thor

    Found the prob, maybe a typo.. Donno if you wanna let the theme author know

    if ( current_user_can( 'delete_others_posts' ) ) { //only admins and editors

    my fix: current_user_can( 'delete_others_posts' )

    If i wanted to redirect a non mod/admin to a specific page how would it look?

    from: functions.php - line 145
    wp_redirect( get_option('siteurl') );

    edit: meh came right - wp_redirect( get_option('siteurl') . '/example.php');

  • Nit3watch
    • Design Lord, Child of Thor

    @Tammie, its not a bug. Its the wrong user role privilege being used in the theme. Only editors and > can delete others posts..

    Do you want to allowed only admin and moderators

    my fix: current_user_can( 'delete_others_posts' )

    meant to be: delete_posts

  • Nit3watch
    • Design Lord, Child of Thor

    @Tammie, compare the user role capabilities for your self:

    https://premium.wpmudev.org/the-buddypress-manual/about-groups-and-user-roles/
    http://codex.wordpress.org/Roles_and_Capabilities

    It wouldn't work for any theme, the wrong capability is being used ( only editors can delete_others_pages, moderators can't )

    the author must change

    Do you want to allowed only admin and moderators to create group?

    to

    Do you want to allowed only admin and editors to create group?

    or he/she must change the capability ( delete_others_posts to delete_posts )

  • Tammie
    • WordPress Wizard

    @Nit3watch: Then you need to report this to BuddyPress if it's in the default theme also they would want to know about that and get it changed if it indeed is on all themes. The roles may have changed and I've not explored this yet myself but reports are always welcome to improve the way things are done over at BuddyPress.

  • Tammie
    • WordPress Wizard

    @Nit3watch: I think there is cross communication on both sides here.

    What I asked you was can you create in the default theme - you seemed to say yes. Therefore it would be a bug to report to BuddyPress to get changed in their theme. That was NOT me saying we'd not also update our theme. I totally understand if there is a bug we change our theme bottom line. I will notify Richie and see if he can take a look at this.

  • Nit3watch
    • Design Lord, Child of Thor

    lol tammie. What I was saying is that if you used:

    if( bp_is_group_create() ) {
    if ( current_user_can( 'delete_others_posts' ) ) { //only admins and modderators
    } else {
    wp_redirect( get_option('siteurl') . '/about');
    }

    in bp-default you would still have the same problem. delete_others_posts does not exist for moderators, therefor you cant use it for moderators.

    As far a I know bp-default doesnt have that function in the theme, if it does, apologies.

    what works in both theme's/all theme's specifically for admins and moderators is:

    if( bp_is_group_create() ) {
    if ( current_user_can( 'delete_posts' ) ) { //only admins and modderators
    } else {
    wp_redirect( get_option('siteurl') . '/about');
    }

    Thats all im trying to say.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.