@ -44,6 +44,7 @@ import org.thingsboard.server.common.data.page.TimePageLink;
import org.thingsboard.server.common.data.plugin.ComponentDescriptor ;
import org.thingsboard.server.common.data.plugin.ComponentDescriptor ;
import org.thingsboard.server.common.data.plugin.ComponentType ;
import org.thingsboard.server.common.data.plugin.ComponentType ;
import org.thingsboard.server.common.data.rule.RuleChain ;
import org.thingsboard.server.common.data.rule.RuleChain ;
import org.thingsboard.server.common.data.rule.RuleNode ;
import org.thingsboard.server.common.data.security.Authority ;
import org.thingsboard.server.common.data.security.Authority ;
import org.thingsboard.server.common.data.widget.WidgetType ;
import org.thingsboard.server.common.data.widget.WidgetType ;
import org.thingsboard.server.common.data.widget.WidgetsBundle ;
import org.thingsboard.server.common.data.widget.WidgetsBundle ;
@ -74,6 +75,9 @@ import org.thingsboard.server.dao.widget.WidgetsBundleService;
import org.thingsboard.server.exception.ThingsboardErrorResponseHandler ;
import org.thingsboard.server.exception.ThingsboardErrorResponseHandler ;
import org.thingsboard.server.service.component.ComponentDiscoveryService ;
import org.thingsboard.server.service.component.ComponentDiscoveryService ;
import org.thingsboard.server.service.security.model.SecurityUser ;
import org.thingsboard.server.service.security.model.SecurityUser ;
import org.thingsboard.server.service.security.permission.AccessControlService ;
import org.thingsboard.server.service.security.permission.Operation ;
import org.thingsboard.server.service.security.permission.Resource ;
import org.thingsboard.server.service.state.DeviceStateService ;
import org.thingsboard.server.service.state.DeviceStateService ;
import org.thingsboard.server.service.telemetry.TelemetrySubscriptionService ;
import org.thingsboard.server.service.telemetry.TelemetrySubscriptionService ;
@ -98,6 +102,9 @@ public abstract class BaseController {
@Autowired
@Autowired
private ThingsboardErrorResponseHandler errorResponseHandler ;
private ThingsboardErrorResponseHandler errorResponseHandler ;
@Autowired
protected AccessControlService accessControlService ;
@Autowired
@Autowired
protected TenantService tenantService ;
protected TenantService tenantService ;
@ -252,13 +259,15 @@ public abstract class BaseController {
}
}
}
}
void checkTenantId ( TenantId tenantId ) throws ThingsboardException {
Tenant checkTenantId ( TenantId tenantId , Operation operation ) throws ThingsboardException {
validateId ( tenantId , INCORRECT_TENANT_ID + tenantId ) ;
try {
SecurityUser authUser = getCurrentUser ( ) ;
validateId ( tenantId , INCORRECT_TENANT_ID + tenantId ) ;
if ( authUser . getAuthority ( ) ! = Authority . SYS_ADMIN & &
Tenant tenant = tenantService . findTenantById ( tenantId ) ;
( authUser . getTenantId ( ) = = null | | ! authUser . getTenantId ( ) . equals ( tenantId ) ) ) {
checkNotNull ( tenant ) ;
throw new ThingsboardException ( YOU_DON_T_HAVE_PERMISSION_TO_PERFORM_THIS_OPERATION ,
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . TENANT , operation , tenantId , tenant ) ;
ThingsboardErrorCode . PERMISSION_DENIED ) ;
return tenant ;
} catch ( Exception e ) {
throw handleException ( e , false ) ;
}
}
}
}
@ -266,80 +275,61 @@ public abstract class BaseController {
return getCurrentUser ( ) . getTenantId ( ) ;
return getCurrentUser ( ) . getTenantId ( ) ;
}
}
Customer checkCustomerId ( CustomerId customerId ) throws ThingsboardException {
Customer checkCustomerId ( CustomerId customerId , Operation operation ) throws ThingsboardException {
try {
try {
SecurityUser authUser = getCurrentUser ( ) ;
validateId ( customerId , "Incorrect customerId " + customerId ) ;
if ( authUser . getAuthority ( ) = = Authority . SYS_ADMIN | |
Customer customer = customerService . findCustomerById ( getTenantId ( ) , customerId ) ;
( authUser . getAuthority ( ) ! = Authority . TENANT_ADMIN & &
checkNotNull ( customer ) ;
( authUser . getCustomerId ( ) = = null | | ! authUser . getCustomerId ( ) . equals ( customerId ) ) ) ) {
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . CUSTOMER , operation , customerId , customer ) ;
throw new ThingsboardException ( YOU_DON_T_HAVE_PERMISSION_TO_PERFORM_THIS_OPERATION ,
return customer ;
ThingsboardErrorCode . PERMISSION_DENIED ) ;
}
if ( customerId ! = null & & ! customerId . isNullUid ( ) ) {
Customer customer = customerService . findCustomerById ( authUser . getTenantId ( ) , customerId ) ;
checkCustomer ( customer ) ;
return customer ;
} else {
return null ;
}
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
private void checkCustomer ( Customer customer ) throws ThingsboardException {
User checkUserId ( UserId userId , Operation operation ) throws ThingsboardException {
checkNotNull ( customer ) ;
checkTenantId ( customer . getTenantId ( ) ) ;
}
User checkUserId ( UserId userId ) throws ThingsboardException {
try {
try {
validateId ( userId , "Incorrect userId " + userId ) ;
validateId ( userId , "Incorrect userId " + userId ) ;
User user = userService . findUserById ( getCurrentUser ( ) . getTenantId ( ) , userId ) ;
User user = userService . findUserById ( getCurrentUser ( ) . getTenantId ( ) , userId ) ;
checkUser ( user ) ;
checkNotNull ( user ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . USER , operation , userId , user ) ;
return user ;
return user ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
private void checkUser ( User user ) throws ThingsboardException {
protected void checkEntityId ( EntityId entityId , Operation operation ) throws ThingsboardException {
checkNotNull ( user ) ;
checkTenantId ( user . getTenantId ( ) ) ;
if ( user . getAuthority ( ) = = Authority . CUSTOMER_USER ) {
checkCustomerId ( user . getCustomerId ( ) ) ;
}
}
protected void checkEntityId ( EntityId entityId ) throws ThingsboardException {
try {
try {
checkNotNull ( entityId ) ;
checkNotNull ( entityId ) ;
validateId ( entityId . getId ( ) , "Incorrect entityId " + entityId ) ;
validateId ( entityId . getId ( ) , "Incorrect entityId " + entityId ) ;
SecurityUser authUser = getCurrentUser ( ) ;
switch ( entityId . getEntityType ( ) ) {
switch ( entityId . getEntityType ( ) ) {
case DEVICE :
case DEVICE :
checkDevice ( deviceService . findDeviceById ( authUser . getTenan tId ( ) , new DeviceId ( entityId . getId ( ) ) ) ) ;
checkDeviceId ( new DeviceId ( entityId . getId ( ) ) , operation ) ;
return ;
return ;
case CUSTOMER :
case CUSTOMER :
checkCustomerId ( new CustomerId ( entityId . getId ( ) ) ) ;
checkCustomerId ( new CustomerId ( entityId . getId ( ) ) , operation ) ;
return ;
return ;
case TENANT :
case TENANT :
checkTenantId ( new TenantId ( entityId . getId ( ) ) ) ;
checkTenantId ( new TenantId ( entityId . getId ( ) ) , operation ) ;
return ;
return ;
case RULE_CHAIN :
case RULE_CHAIN :
checkRuleChain ( new RuleChainId ( entityId . getId ( ) ) ) ;
checkRuleChain ( new RuleChainId ( entityId . getId ( ) ) , operation ) ;
return ;
case RULE_NODE :
checkRuleNode ( new RuleNodeId ( entityId . getId ( ) ) , operation ) ;
return ;
return ;
case ASSET :
case ASSET :
checkAsset ( assetService . findAssetById ( authUser . getTenantId ( ) , new AssetId ( entityId . getId ( ) ) ) ) ;
checkAssetId ( new AssetId ( entityId . getId ( ) ) , operation ) ;
return ;
return ;
case DASHBOARD :
case DASHBOARD :
checkDashboardId ( new DashboardId ( entityId . getId ( ) ) ) ;
checkDashboardId ( new DashboardId ( entityId . getId ( ) ) , operation ) ;
return ;
return ;
case USER :
case USER :
checkUserId ( new UserId ( entityId . getId ( ) ) ) ;
checkUserId ( new UserId ( entityId . getId ( ) ) , operation ) ;
return ;
return ;
case ENTITY_VIEW :
case ENTITY_VIEW :
checkEntityViewId ( new EntityViewId ( entityId . getId ( ) ) ) ;
checkEntityViewId ( new EntityViewId ( entityId . getId ( ) ) , operation ) ;
return ;
return ;
default :
default :
throw new IllegalArgumentException ( "Unsupported entity type: " + entityId . getEntityType ( ) ) ;
throw new IllegalArgumentException ( "Unsupported entity type: " + entityId . getEntityType ( ) ) ;
@ -349,160 +339,114 @@ public abstract class BaseController {
}
}
}
}
Device checkDeviceId ( DeviceId deviceId ) throws ThingsboardException {
Device checkDeviceId ( DeviceId deviceId , Operation operation ) throws ThingsboardException {
try {
try {
validateId ( deviceId , "Incorrect deviceId " + deviceId ) ;
validateId ( deviceId , "Incorrect deviceId " + deviceId ) ;
Device device = deviceService . findDeviceById ( getCurrentUser ( ) . getTenantId ( ) , deviceId ) ;
Device device = deviceService . findDeviceById ( getCurrentUser ( ) . getTenantId ( ) , deviceId ) ;
checkDevice ( device ) ;
checkNotNull ( device ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . DEVICE , operation , deviceId , device ) ;
return device ;
return device ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
protected void checkDevice ( Device device ) throws ThingsboardException {
protected EntityView checkEntityViewId ( EntityViewId entityViewId , Operation operation ) throws ThingsboardException {
checkNotNull ( device ) ;
checkTenantId ( device . getTenantId ( ) ) ;
checkCustomerId ( device . getCustomerId ( ) ) ;
}
protected EntityView checkEntityViewId ( EntityViewId entityViewId ) throws ThingsboardException {
try {
try {
validateId ( entityViewId , "Incorrect entityViewId " + entityViewId ) ;
validateId ( entityViewId , "Incorrect entityViewId " + entityViewId ) ;
EntityView entityView = entityViewService . findEntityViewById ( getCurrentUser ( ) . getTenantId ( ) , entityViewId ) ;
EntityView entityView = entityViewService . findEntityViewById ( getCurrentUser ( ) . getTenantId ( ) , entityViewId ) ;
checkEntityView ( entityView ) ;
checkNotNull ( entityView ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . ENTITY_VIEW , operation , entityViewId , entityView ) ;
return entityView ;
return entityView ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
protected void checkEntityView ( EntityView entityView ) throws ThingsboardException {
Asset checkAssetId ( AssetId assetId , Operation operation ) throws ThingsboardException {
checkNotNull ( entityView ) ;
checkTenantId ( entityView . getTenantId ( ) ) ;
checkCustomerId ( entityView . getCustomerId ( ) ) ;
}
Asset checkAssetId ( AssetId assetId ) throws ThingsboardException {
try {
try {
validateId ( assetId , "Incorrect assetId " + assetId ) ;
validateId ( assetId , "Incorrect assetId " + assetId ) ;
Asset asset = assetService . findAssetById ( getCurrentUser ( ) . getTenantId ( ) , assetId ) ;
Asset asset = assetService . findAssetById ( getCurrentUser ( ) . getTenantId ( ) , assetId ) ;
checkAsset ( asset ) ;
checkNotNull ( asset ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . ASSET , operation , assetId , asset ) ;
return asset ;
return asset ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
protected void checkAsset ( Asset asset ) throws ThingsboardException {
Alarm checkAlarmId ( AlarmId alarmId , Operation operation ) throws ThingsboardException {
checkNotNull ( asset ) ;
checkTenantId ( asset . getTenantId ( ) ) ;
checkCustomerId ( asset . getCustomerId ( ) ) ;
}
Alarm checkAlarmId ( AlarmId alarmId ) throws ThingsboardException {
try {
try {
validateId ( alarmId , "Incorrect alarmId " + alarmId ) ;
validateId ( alarmId , "Incorrect alarmId " + alarmId ) ;
Alarm alarm = alarmService . findAlarmByIdAsync ( getCurrentUser ( ) . getTenantId ( ) , alarmId ) . get ( ) ;
Alarm alarm = alarmService . findAlarmByIdAsync ( getCurrentUser ( ) . getTenantId ( ) , alarmId ) . get ( ) ;
checkAlarm ( alarm ) ;
checkNotNull ( alarm ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . ALARM , operation , alarmId , alarm ) ;
return alarm ;
return alarm ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
AlarmInfo checkAlarmInfoId ( AlarmId alarmId ) throws ThingsboardException {
AlarmInfo checkAlarmInfoId ( AlarmId alarmId , Operation operation ) throws ThingsboardException {
try {
try {
validateId ( alarmId , "Incorrect alarmId " + alarmId ) ;
validateId ( alarmId , "Incorrect alarmId " + alarmId ) ;
AlarmInfo alarmInfo = alarmService . findAlarmInfoByIdAsync ( getCurrentUser ( ) . getTenantId ( ) , alarmId ) . get ( ) ;
AlarmInfo alarmInfo = alarmService . findAlarmInfoByIdAsync ( getCurrentUser ( ) . getTenantId ( ) , alarmId ) . get ( ) ;
checkAlarm ( alarmInfo ) ;
checkNotNull ( alarmInfo ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . ALARM , operation , alarmId , alarmInfo ) ;
return alarmInfo ;
return alarmInfo ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
protected void checkAlarm ( Alarm alarm ) throws ThingsboardException {
WidgetsBundle checkWidgetsBundleId ( WidgetsBundleId widgetsBundleId , Operation operation ) throws ThingsboardException {
checkNotNull ( alarm ) ;
checkTenantId ( alarm . getTenantId ( ) ) ;
}
WidgetsBundle checkWidgetsBundleId ( WidgetsBundleId widgetsBundleId , boolean modify ) throws ThingsboardException {
try {
try {
validateId ( widgetsBundleId , "Incorrect widgetsBundleId " + widgetsBundleId ) ;
validateId ( widgetsBundleId , "Incorrect widgetsBundleId " + widgetsBundleId ) ;
WidgetsBundle widgetsBundle = widgetsBundleService . findWidgetsBundleById ( getCurrentUser ( ) . getTenantId ( ) , widgetsBundleId ) ;
WidgetsBundle widgetsBundle = widgetsBundleService . findWidgetsBundleById ( getCurrentUser ( ) . getTenantId ( ) , widgetsBundleId ) ;
checkWidgetsBundle ( widgetsBundle , modify ) ;
checkNotNull ( widgetsBundle ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . WIDGETS_BUNDLE , operation , widgetsBundleId , widgetsBundle ) ;
return widgetsBundle ;
return widgetsBundle ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
private void checkWidgetsBundle ( WidgetsBundle widgetsBundle , boolean modify ) throws ThingsboardException {
WidgetType checkWidgetTypeId ( WidgetTypeId widgetTypeId , Operation operation ) throws ThingsboardException {
checkNotNull ( widgetsBundle ) ;
if ( widgetsBundle . getTenantId ( ) ! = null & & ! widgetsBundle . getTenantId ( ) . getId ( ) . equals ( ModelConstants . NULL_UUID ) ) {
checkTenantId ( widgetsBundle . getTenantId ( ) ) ;
} else if ( modify & & getCurrentUser ( ) . getAuthority ( ) ! = Authority . SYS_ADMIN ) {
throw new ThingsboardException ( YOU_DON_T_HAVE_PERMISSION_TO_PERFORM_THIS_OPERATION ,
ThingsboardErrorCode . PERMISSION_DENIED ) ;
}
}
WidgetType checkWidgetTypeId ( WidgetTypeId widgetTypeId , boolean modify ) throws ThingsboardException {
try {
try {
validateId ( widgetTypeId , "Incorrect widgetTypeId " + widgetTypeId ) ;
validateId ( widgetTypeId , "Incorrect widgetTypeId " + widgetTypeId ) ;
WidgetType widgetType = widgetTypeService . findWidgetTypeById ( getCurrentUser ( ) . getTenantId ( ) , widgetTypeId ) ;
WidgetType widgetType = widgetTypeService . findWidgetTypeById ( getCurrentUser ( ) . getTenantId ( ) , widgetTypeId ) ;
checkWidgetType ( widgetType , modify ) ;
checkNotNull ( widgetType ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . WIDGET_TYPE , operation , widgetTypeId , widgetType ) ;
return widgetType ;
return widgetType ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
void checkWidgetType ( WidgetType widgetType , boolean modify ) throws ThingsboardException {
Dashboard checkDashboardId ( DashboardId dashboardId , Operation operation ) throws ThingsboardException {
checkNotNull ( widgetType ) ;
if ( widgetType . getTenantId ( ) ! = null & & ! widgetType . getTenantId ( ) . getId ( ) . equals ( ModelConstants . NULL_UUID ) ) {
checkTenantId ( widgetType . getTenantId ( ) ) ;
} else if ( modify & & getCurrentUser ( ) . getAuthority ( ) ! = Authority . SYS_ADMIN ) {
throw new ThingsboardException ( YOU_DON_T_HAVE_PERMISSION_TO_PERFORM_THIS_OPERATION ,
ThingsboardErrorCode . PERMISSION_DENIED ) ;
}
}
Dashboard checkDashboardId ( DashboardId dashboardId ) throws ThingsboardException {
try {
try {
validateId ( dashboardId , "Incorrect dashboardId " + dashboardId ) ;
validateId ( dashboardId , "Incorrect dashboardId " + dashboardId ) ;
Dashboard dashboard = dashboardService . findDashboardById ( getCurrentUser ( ) . getTenantId ( ) , dashboardId ) ;
Dashboard dashboard = dashboardService . findDashboardById ( getCurrentUser ( ) . getTenantId ( ) , dashboardId ) ;
checkDashboard ( dashboard ) ;
checkNotNull ( dashboard ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . DASHBOARD , operation , dashboardId , dashboard ) ;
return dashboard ;
return dashboard ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
DashboardInfo checkDashboardInfoId ( DashboardId dashboardId ) throws ThingsboardException {
DashboardInfo checkDashboardInfoId ( DashboardId dashboardId , Operation operation ) throws ThingsboardException {
try {
try {
validateId ( dashboardId , "Incorrect dashboardId " + dashboardId ) ;
validateId ( dashboardId , "Incorrect dashboardId " + dashboardId ) ;
DashboardInfo dashboardInfo = dashboardService . findDashboardInfoById ( getCurrentUser ( ) . getTenantId ( ) , dashboardId ) ;
DashboardInfo dashboardInfo = dashboardService . findDashboardInfoById ( getCurrentUser ( ) . getTenantId ( ) , dashboardId ) ;
checkDashboard ( dashboardInfo ) ;
checkNotNull ( dashboardInfo ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . DASHBOARD , operation , dashboardId , dashboardInfo ) ;
return dashboardInfo ;
return dashboardInfo ;
} catch ( Exception e ) {
} catch ( Exception e ) {
throw handleException ( e , false ) ;
throw handleException ( e , false ) ;
}
}
}
}
private void checkDashboard ( DashboardInfo dashboard ) throws ThingsboardException {
checkNotNull ( dashboard ) ;
checkTenantId ( dashboard . getTenantId ( ) ) ;
SecurityUser authUser = getCurrentUser ( ) ;
if ( authUser . getAuthority ( ) = = Authority . CUSTOMER_USER ) {
if ( ! dashboard . isAssignedToCustomer ( authUser . getCustomerId ( ) ) ) {
throw new ThingsboardException ( YOU_DON_T_HAVE_PERMISSION_TO_PERFORM_THIS_OPERATION ,
ThingsboardErrorCode . PERMISSION_DENIED ) ;
}
}
}
ComponentDescriptor checkComponentDescriptorByClazz ( String clazz ) throws ThingsboardException {
ComponentDescriptor checkComponentDescriptorByClazz ( String clazz ) throws ThingsboardException {
try {
try {
log . debug ( "[{}] Lookup component descriptor" , clazz ) ;
log . debug ( "[{}] Lookup component descriptor" , clazz ) ;
@ -530,24 +474,22 @@ public abstract class BaseController {
}
}
}
}
protected RuleChain checkRuleChain ( RuleChainId ruleChainId ) throws ThingsboardException {
protected RuleChain checkRuleChain ( RuleChainId ruleChainId , Operation operation ) throws ThingsboardException {
checkNotNull ( ruleChainId ) ;
validateId ( ruleChainId , "Incorrect ruleChainId " + ruleChainId ) ;
return checkRuleChain ( ruleChainService . findRuleChainById ( getCurrentUser ( ) . getTenantId ( ) , ruleChainId ) ) ;
RuleChain ruleChain = ruleChainService . findRuleChainById ( getCurrentUser ( ) . getTenantId ( ) , ruleChainId ) ;
}
protected RuleChain checkRuleChain ( RuleChain ruleChain ) throws ThingsboardException {
checkNotNull ( ruleChain ) ;
checkNotNull ( ruleChain ) ;
SecurityUser authUser = getCurrentUser ( ) ;
accessControlService . checkPermission ( getCurrentUser ( ) , Resource . RULE_CHAIN , operation , ruleChainId , ruleChain ) ;
TenantId tenantId = ruleChain . getTenantId ( ) ;
validateId ( tenantId , INCORRECT_TENANT_ID + tenantId ) ;
if ( authUser . getAuthority ( ) ! = Authority . TENANT_ADMIN | |
! authUser . getTenantId ( ) . equals ( tenantId ) ) {
throw new ThingsboardException ( YOU_DON_T_HAVE_PERMISSION_TO_PERFORM_THIS_OPERATION ,
ThingsboardErrorCode . PERMISSION_DENIED ) ;
}
return ruleChain ;
return ruleChain ;
}
}
protected RuleNode checkRuleNode ( RuleNodeId ruleNodeId , Operation operation ) throws ThingsboardException {
validateId ( ruleNodeId , "Incorrect ruleNodeId " + ruleNodeId ) ;
RuleNode ruleNode = ruleChainService . findRuleNodeById ( getTenantId ( ) , ruleNodeId ) ;
checkNotNull ( ruleNode ) ;
checkRuleChain ( ruleNode . getRuleChainId ( ) , operation ) ;
return ruleNode ;
}
protected String constructBaseUrl ( HttpServletRequest request ) {
protected String constructBaseUrl ( HttpServletRequest request ) {
String scheme = request . getScheme ( ) ;
String scheme = request . getScheme ( ) ;