SmartClient Version: v13.1p_2026-10-21/Enterprise Deployment (built 2026-10-21)
Hi, I just noticed a potential problem with the requiresRole.
While I’m still not sure that it’s a sensible use case, I just want to ask if it’s an expected behaviour. Test case:
<DataSource
ID="AUTH_USERS"
serverType="sql"
dbName="dbJFrame"
schema="DBJFRAME"
tableName="AUTH_USERS"
allowAdvancedCriteria="true"
useAnsiJoins="true"
requiresAuthentication="true"
dropExtraFields="false"
>
<fields>
<field name="ID_REC" primaryKey="true" type="sequence" hidden="true" sequenceName="SEQUENCE_AUTH"/>
<field name="EMAIL" type="text" length="200" required="true">
<!--...other fields availbale for ROLE_ADMIN-->
</field>
</fields>
<operationBindings>
<operationBinding operationType="fetch" operationId="foobar" requiresRole="" outputs="EMAIL">
</operationBinding>
<operationBinding operationType="fetch" requiresRole="ROLE_ADMIN"/>
</operationBindings>
</DataSource>
<DataSource
ID="AUTH_USERS_ROLES"
serverType="sql"
dbName="dbJFrame"
schema="DBJFRAME"
tableName="AUTH_USERS_ROLES"
allowAdvancedCriteria="true"
useAnsiJoins="true"
requiresAuthentication="true"
dropExtraFields="false"
>
<fields>
<field name="ID_REC" primaryKey="true" type="sequence" hidden="true" sequenceName="SEQUENCE_AUTH"/>
<field name="ID_USER_FK" type="integer" foreignKey="AUTH_USERS.ID_REC" relatedTableAlias="USERS" required="true"/>
<field name="EMAIL" type="text" includeFrom="AUTH_USERS.EMAIL" includeVia="ID_USER_FK"/>
</fields>
</DataSource>
If I don’t have ROLE_ADMIN and I execute:
- AUTH_USERS.fetchData(null,null,{operationId:“foobar”}), it works as it’s an “open” operation.
- AUTH_USERS_ROLES.fetchData(), I get an AUTHORIZATION_FAILURE and that’s expected.
- But if I execute AUTH_USERS_ROLES.fetchData(null, null, {operationId:“foobar”}), it works, as apparently it’s using the operationId foobar. This seems unexpected as foobar is defined on AUTH_USERS, not on AUTH_USERS_ROLES.
Is it a bug, or am I missing something?