Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change group role capabilities

  • @davelr1

    Participant

    Hi!

    I want to change the regular group role capabilities but I just can’t find the place where these capabilities are defined. I found where I can edit side-wide admins/mods capabilities but not for the group ones.

    By now… a group moderator can only edit replies/topics and mark as spam. I would like to give them the capability to also kick/ban members. I just want to set that because some groups have a lot of members and the admin need some extra help keeping everything clean without the need to promote others as admin.

    I already set a menu above users avatar’s generating the ban/kick link.. so.. there’s no need for group mods have the permission to access group admin page.

    Wordpress 4.1.1
    Buddypress Version 2.2.1

    Thank you for your attention! =)

Viewing 4 replies - 1 through 4 (of 4 total)
  • @shanebp

    Moderator

    I don’t think it’s possible without writing some custom sql to set the status of a member that should be kicked/banned.

    All of the core group code uses bp_is_item_admin to check whether a person is a group admin.
    If they aren’t, then kick/ban is not allowed.

    >I already set a menu above users avatar’s generating the ban/kick link
    On what screen does that link appear?
    I would try writing a function that is triggered by the link.
    The function would check to see if the clicker is a mod and then run some custom sql.

    @davelr1

    Participant

    Hi!

    The links appears at loop-single-reply.php
    I just use the code above to get the kick/ban/unban links.

      <?php if ( bp_group_is_mod() || bp_group_is_admin() ): ?>		
      <select onChange="window.location.href=this.value">
      <option>- Manage </option>
      <option value="<?php $user_id = bbp_get_reply_author_id(); bp_group_member_remove_link( $user_id ); ?>"><?php _e( 'Kick', 'InspireBook' ); ?></option>
      <option value="<?php $user_id = bbp_get_reply_author_id();  bp_group_member_ban_link( $user_id ); ?>"><?php _e( 'Ban', 'InspireBook' ); ?></option>
      <option value="<?php $user_id = bbp_get_reply_author_id();  bp_group_member_unban_link( $user_id ); ?>"><?php _e( 'Unban', 'InspireBook' ); ?></option>
      </select>
      <?php endif; ?>

    Thank you for your reply and explanation!

    @shanebp

    Moderator

    So you’re putting the link above the avatar on a Forum page.

    And if they select one of the options – then what?
    I think your best bet is to write some ajax whose callback function uses custom sql.

    @davelr1

    Participant

    The links works just fine for group admins.

    Ajax seems a great solution to avoid being redirected to the “manage members” page!

    I will check that.

    Thank you =)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change group role capabilities’ is closed to new replies.
Skip to toolbar