コード例 #1
0
 /**
  *  Initilize ACL on plugins_loaded with 15 priority. So that before this gets executed;
  *  other addon plugins get chance to hook into it and register themselved
  */
 public function init_acl()
 {
     /**
      *
      *  Filter for other addons to register.
      *  Array Structure is array( 'module_slug' => array() )
      *
      *  $biz_module = array(
      *        RTBIZ_TEXT_DOMAIN => array(
      *            'label' => __( 'rtBiz' ),                                                                   // module label
      *            'post_types' => array( 'post', 'page', 'rtbiz_contact', 'rt_lead', ),                          // array of post type for given module
      *          'team_support' => array( 'rtbiz_contact', 'rt_ticket' ),                                 // array of post types for which team taxonomy is to be registered
      *          'product_support' => array( 'rtbiz_contact', 'rt_ticket' ),                                   // array of post types for which products taxonomy is to be registered
      *          'setting_option_name' => 'redux_biz_settings',                                              // redux opions Name, if used
      *          'setting_page_url' => 'http://rtbiz.rtcamp.net/wp-admin/admin.php?page=rt-biz-settings',    // Settings Page URL, if Mailbox module is used.
      *        ),
      *  );
      */
     self::$modules = apply_filters('rtbiz_modules', array());
     self::$permissions = apply_filters('rtbiz_permissions', array('no_access' => array('value' => 0, 'name' => __('No Role'), 'tooltip' => __('No Access')), 'author' => array('value' => 10, 'name' => __('Author'), 'tooltip' => __('Read/Write (Self)')), 'editor' => array('value' => 20, 'name' => __('Editor'), 'tooltip' => __('Read/Write (Everything)')), 'admin' => array('value' => 30, 'name' => __('Admin'), 'tooltip' => __('Read/Write (Everything) + Settings'))));
 }
コード例 #2
0
/**
 * @param $module_key
 * @param string $role
 *
 * @return string
 */
function rtbiz_get_access_role_cap($module_key, $role = 'no_access')
{
    return Rtbiz_Access_Control::get_capability_from_access_role($module_key, $role);
}