Skip to:
Content

bbPress.org

Changeset 4678


Ignore:
Timestamp:
12/31/2012 04:25:35 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Capabilities:

  • Allow keymaster role to use Forums tools and save Forums settings.
  • Fixes #2139.
Location:
trunk/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/admin/admin.php

    r4651 r4678  
    5050         * @var bool Minimum capability to access Tools and Settings
    5151         */
    52         public $minimum_capability = 'manage_options';
     52        public $minimum_capability = 'keep_gate';
    5353
    5454        /** Functions *************************************************************/
    … …  
    142142                // Hide the theme compat package selection
    143143                add_filter( 'bbp_admin_get_settings_sections', array( $this, 'hide_theme_compat_packages' ) );
     144
     145                // Allow keymasters to save forums settings
     146                add_filter( 'option_page_capability_bbpress',  array( $this, 'option_page_capability_bbpress' ) );
    144147
    145148                /** Network Admin *****************************************************/
    … …  
    12591262
    12601263                return $sections;
     1264        }
     1265
     1266        /**
     1267         * Allow keymaster role to save Forums settings
     1268         *
     1269         * @since bbPress (r4678)
     1270         *
     1271         * @param string $capability
     1272         * @return string Return 'keep_gate' capability
     1273         */
     1274        public function option_page_capability_bbpress( $capability = 'manage_options' ) {
     1275                $capability = 'keep_gate';
     1276                return $capability;
    12611277        }
    12621278
  • trunk/includes/forums/capabilities.php

    r4446 r4678  
    177177
    178178                case 'bbp_forums_admin' :
    179                         $caps = array( 'manage_options' );
     179                        $caps = array( 'keep_gate' );
    180180                        break;
    181181        }
Note: See TracChangeset for help on using the changeset viewer.