Hello,
We're having a problem using editRequiresRole in a Datasource and we can't figure out what's causing it. Of course, it works perfectly in our development environment but works differently on our QC server. I verified that the files were installed correctly on the QC server.
In the datasource, we have the fields set with :
<field name="CODE" title="PAS" type="text" length="4" editRequiresRole="HSA" />
<field name="PAL4_ID" title="PAL4" type="PAL4_ID_TYPE" editRequiresRole="HSA,MSA,MO"/>
Our ListGrid has the following in the canEditCell function.
canEditCell : function (rowNum, colNum) {
// get the default editability of this cell.
var superCanEditCell = this.Super("canEditCell", arguments); // Answers the question: Can you edit this *field* based on your role?
// the record
var record = this.getRecord(rowNum);
// the field name
var fieldName = this.getFieldName(colNum);
// the datasource name
var datasourceName = this.getDataSource().name;
isc.logEcho( superCanEditCell , "[" + fieldName + "] super" );
isc.logEcho( record["_canEdit"], "[" + fieldName + "] _canEdit" );
// if the record has the _canEdit flag and the user cannot edit, that takes precedent over
// everything else.
if (record && record["_canEdit"] != null && record["_canEdit"] == false) {
// _canEdit is a row based and answers the question: can you edit a record in this Command?
return record["_canEdit"] && superCanEditCell;
}
return superCanEditCell;
}
When running in development, we get the following debugging:
On the QC server and added in the same debugging. We get:
I am assuming that calling this.Super("canEditCell", arguments) *should* return the correct boolean based on the editRequiredRole in the datasource. I'm scratching my head trying to think of what would impact this.
Really, I'm looking for some guidance on where I should be looking. I'm not certain what the editRequiredRole uses to verify the role. I am assuming something is set in the session with those roles.
Specifics:
SmartClient Version: v10.1p_2019-08-29/Enterprise Deployment (built 2019-08-29)
Browsers: Chrome, IE, Firefox.
We're having a problem using editRequiresRole in a Datasource and we can't figure out what's causing it. Of course, it works perfectly in our development environment but works differently on our QC server. I verified that the files were installed correctly on the QC server.
In the datasource, we have the fields set with :
<field name="CODE" title="PAS" type="text" length="4" editRequiresRole="HSA" />
<field name="PAL4_ID" title="PAL4" type="PAL4_ID_TYPE" editRequiresRole="HSA,MSA,MO"/>
Our ListGrid has the following in the canEditCell function.
canEditCell : function (rowNum, colNum) {
// get the default editability of this cell.
var superCanEditCell = this.Super("canEditCell", arguments); // Answers the question: Can you edit this *field* based on your role?
// the record
var record = this.getRecord(rowNum);
// the field name
var fieldName = this.getFieldName(colNum);
// the datasource name
var datasourceName = this.getDataSource().name;
isc.logEcho( superCanEditCell , "[" + fieldName + "] super" );
isc.logEcho( record["_canEdit"], "[" + fieldName + "] _canEdit" );
// if the record has the _canEdit flag and the user cannot edit, that takes precedent over
// everything else.
if (record && record["_canEdit"] != null && record["_canEdit"] == false) {
// _canEdit is a row based and answers the question: can you edit a record in this Command?
return record["_canEdit"] && superCanEditCell;
}
return superCanEditCell;
}
When running in development, we get the following debugging:
11:48:28.224:TMR9:WARN:Log:[CODE] super: false
11:48:28.224:TMR9:WARN:Log:[CODE] _canEdit: true
11:48:28.226:TMR9:WARN:Log:[PAL4_ID] super: true
11:48:28.226:TMR9:WARN:Log:[PAL4_ID] _canEdit: true
11:48:28.226:TMR9:WARN:Log:[PAL4_ID] super: true
11:48:28.226:TMR9:WARN:Log:[PAL4_ID] _canEdit: true
On the QC server and added in the same debugging. We get:
11:59:08.485:TMR9:WARN:Log:[CODE] super: true
11:59:08.485:TMR9:WARN:Log:[CODE] _canEdit: true
11:59:08.566:TMR9:WARN:Log:[PAL4_ID] super: true
11:59:08.566:TMR9:WARN:Log:[PAL4_ID] _canEdit: true
11:59:08.485:TMR9:WARN:Log:[CODE] _canEdit: true
11:59:08.566:TMR9:WARN:Log:[PAL4_ID] super: true
11:59:08.566:TMR9:WARN:Log:[PAL4_ID] _canEdit: true
I am assuming that calling this.Super("canEditCell", arguments) *should* return the correct boolean based on the editRequiredRole in the datasource. I'm scratching my head trying to think of what would impact this.
Really, I'm looking for some guidance on where I should be looking. I'm not certain what the editRequiredRole uses to verify the role. I am assuming something is set in the session with those roles.
Specifics:
SmartClient Version: v10.1p_2019-08-29/Enterprise Deployment (built 2019-08-29)
Browsers: Chrome, IE, Firefox.
Comment