SmartClient Version: SNAPSHOT_v12.1d_2019-04-23/EVAL Deployment (expires 2019.06.22_07.35.36) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)
Hello, I'm trying to override SQLDataSource, because I want to add some security contraints commons to many dataSources, for the different operationTypes.
Hope that in this use case makes sense to override SQLDataSource.
The override is declared like this:
and in the dataSource:
Then I call (from client) an updateData which uses a DMI:
This is the log of the updateData payload:
The problem is that in the execute method of my SecureDataSource class I see operationType 'fetch' instead of 'update'. Also I see only the criteria and no values, and also no operationId.
After, it enters my update DMI, where the operationType and the other parameters are correct.
Why is that? Am I doing something wrong?
Hello, I'm trying to override SQLDataSource, because I want to add some security contraints commons to many dataSources, for the different operationTypes.
Hope that in this use case makes sense to override SQLDataSource.
The override is declared like this:
Code:
public class SecureDataSource extends SQLDataSource { public DSResponse execute(DSRequest req) throws Exception { System.out.println("operationType: " + req.getOperationType()); final HttpServletRequest httpServletRequest = req.getHttpServletRequest(); final boolean isClub = req.isUserInRole("ROLE_JOFC_CLUB_GENERIC", httpServletRequest); if (isClub) { // check the operationType and set criteria or values } return super.execute(req); }
Code:
serverConstructor="com.juve.jofc.SecureDataSource"
Code:
<operationBinding operationType="update" operationId="updateStato" serverMethod="updateStato" requiresRole="ROLE_OFFICE_CLUB" requires="true"> <serverObject lookupStyle="new" className="com.juve.jofc.approvazione.ApprovazioneJOFCDMI"/> </operationBinding>
Code:
criteria:{ ID_REC:4016 }, values:{ ID_REC:4016, STATE_CODE:"PROPOSTA_ACCETTATA" }, operationConfig:{ dataSource:"JOFC_DOMANDE_AFFILIAZIONE", repo:null, operationType:"update", textMatchStyle:"exact" }, componentId:"approvazioneJOFCGrid", appID:"builtinApplication", operation:"updateStato", oldValues:{ STATO:"PRO", NAZIONE:"Bermuda", EMAIL:"fhgfhfg@fff.ks", MODIFIER_TIMESTAMP:new Date(1554385312000), STATE_CODE:"PROPOSTA_INVIATA", ID_REC:4016, ID_NAZIONE_FK:23, CREATOR_TIMESTAMP:new Date(1554385312000), HA_NULLA_OSTA:false, TELEFONO:"556546564", LOCALITA:"ddddd", NOME_FAN_CLUB:"dsffdsfdsdfs", N_INIZIALE_SOCI:55, DATA_PROPOSTA:new Date(1554328800000), _selection_53:false, _embeddedComponents_approvazioneJOFCGrid:null } }
After, it enters my update DMI, where the operationType and the other parameters are correct.
Why is that? Am I doing something wrong?
Comment