Skip to:
Content

bbPress.org

Changeset 4185


Ignore:
Timestamp:
09/04/2012 08:36:05 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Capabilities:

  • Rename global role masking to bbp_set_current_user_default_role().
  • Update phpdoc and action usages.
  • See #1942.
Location:
branches/plugin/bbp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-actions.php

    r4181 r4185  
    114114
    115115// Multisite Global Forum Access
    116 add_action( 'bbp_setup_current_user', 'bbp_global_access_role_mask', 10 );
     116add_action( 'bbp_setup_current_user', 'bbp_set_current_user_default_role', 10 );
    117117
    118118// Widgets
     
    224224add_action( 'make_ham_user',  'bbp_make_ham_user'  );
    225225add_action( 'make_spam_user', 'bbp_make_spam_user' );
    226 
    227 // User role
    228 add_action( 'bbp_new_topic', 'bbp_global_access_auto_role' );
    229 add_action( 'bbp_new_reply', 'bbp_global_access_auto_role' );
    230226
    231227// Caches
  • branches/plugin/bbp-includes/bbp-core-caps.php

    r4184 r4185  
    751751
    752752/**
    753  * Add the default role and mapped bbPress caps to the current user if needed
     753 * Add the default role to the current user if needed
    754754 *
    755755 * This function will bail if the forum is not global in a multisite
    756756 * installation of WordPress, or if the user is marked as spam or deleted.
    757  *
    758  * Note that we do not currently add a capability for the default role of the
    759  * site. This is to prevent unauthorized role-based access, since we have no
    760  * idea what plugins might be doing to that role. This may change in the future,
    761  * so it's best not to rely heavily on this for now.
    762757 *
    763758 * @since bbPress (r3380)
     
    768763 * @uses current_user_can()
    769764 * @uses get_option()
    770  * @uses bbp_get_caps_for_role()
    771765 *
    772766 * @return If not multisite, not global, or user is deleted/spammed
    773767 */
    774 function bbp_global_access_role_mask() {
     768function bbp_set_current_user_default_role() {
    775769
    776770    // Bail if forum is not global
     
    786780        return;
    787781
    788     // Assign the role and mapped caps to the current user
     782    // Assign the default role to the current user
    789783    bbpress()->current_user->set_role( get_option( 'default_role', 'subscriber' ) );
    790784}
Note: See TracChangeset for help on using the changeset viewer.