requiresRole and includeFrom

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?

also note that here SmartClient™ Reference 13.1p Enterprise [2026-10-25]
there’s a little typo:

The second operationBinding requires the “manager” role even though there is no explicit requiresRole declaration. To prevent the “manager” role being required by the second operationBinding, add requireRole="".

tha latter should be require(s)Role

I think I’ve found another issue, which I’ve chosen to report to you privately.

Yes, this is a bug — the related DataSource’s default operation requiresRole (ROLE_ADMIN in your case) should be respected when fetching includeFrom fields.

This is now fixed and available in nightly builds starting Nov 1.

I can confirm the fix, thank you very much!

Could I please confirm whether you received the message regarding the other issue?

Yes, we did. That one is addressed as well, and you should already have the fix.

1 Like