In honor of this request's one month anniversary, I have written some code to make Flutter Write Post Panel access match RS-defined Category Restrictions / Roles! It requires the addition of a couple hooks in the Flutter code, which I have submitted a support request for.
Once those hooks are in place, you can wait for the next RS release or make it work now by adding this at the top of role-scoper/admin/admin_rs.php. Just below require_once( 'admin_ui_lib_rs.php' ); would be fine:
if ( is_admin() && defined( 'FLUTTER_NAME' ) ) {
add_filter( 'panels_where_fp', array( 'ScoperFlutterHelper', 'flt_panels_where_fp' ) );
add_action('admin_head-post-new.php', array('ScoperFlutterHelper', 'act_flutter_panel_access') );
add_action('admin_head-page-new.php', array('ScoperFlutterHelper', 'act_flutter_panel_access') );
}
Class ScoperFlutterHelper {
function flt_panels_where_fp ( $where ) {
global $scoper;
if ( $cat_ids = $scoper->get_terms( 'category', true, COL_ID_RS ) )
$where .= " AND type != 'post' OR id IN ( SELECT panel_id FROM " . RC_CWP_TABLE_PANEL_CATEGORY . " WHERE cat_id IN ('" . implode( "','", $cat_ids ) . "') )";
else
$where .= " AND type != 'post' ";
return $where;
}
function act_flutter_panel_access() {
if ( ! isset( $_GET['custom-write-panel-id'] ) || is_administrator_rs() )
return;
if ( ! $panel = RCCWP_CustomWritePanel::Get( $_GET['custom-write-panel-id'] ) )
return;
// we currently only filter for post panels
if ( 'post' != $panel->type )
return;
global $scoper;
if ( $cat_ids = $scoper->get_terms( 'category', true, COL_ID_RS ) )
if ( scoper_get_var( "SELECT panel_id FROM " . RC_CWP_TABLE_PANEL_CATEGORY . " WHERE cat_id IN ('" . implode( "','", $cat_ids ) . "') AND panel_id = '{$panel->id}'" ) )
return;
// don't block panel access if it's explicitly assigned via Panel cap
if ( current_user_can( $panel->capability_name ) )
return;
// user doesn't have access based on category or panel capability for requested custom Write Panel, so redirect to generic Write Post form
wp_redirect( 'post-new.php' );
}
}