String method = request.getMethod();
// System.out.println( "request: " + name + "/" + method );
if ( view_mode ){
/*
request: PluginInterface/getDownloadManager
request: PluginInterface/getPluginconfig
request: PluginConfig/getPluginStringParameter[String,String]
request: DownloadManager/getDownloads
request: PluginConfig/getPluginIntParameter[String,int]
request: PluginInterface/getIPFilter
request: PluginConfig/setPluginParameter[String,int]
request: PluginConfig/save
*/
boolean ok = false;
if ( name.equals( "PluginInterface" )){
ok = method.equals( "getPluginconfig" ) ||
method.equals( "getDownloadManager" ) ||
method.equals( "getIPFilter" );
}else if ( name.equals( "DownloadManager" )){
ok = method.equals( "getDownloads" );
}else if ( name.equals( "PluginConfig" )){
if ( method.startsWith( "getPlugin") ||
method.equals( "save" )){
ok = true;
}else if ( method.equals( "setPluginParameter[String,int]" )){
String param = (String)request.getParams()[0];
ok = param.equals( "MDConfigModel:refresh_period" );
}
}
if ( !ok ){
throw new RPMethodAccessDeniedException();
}
}