Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    <serverObject> not always called for a dataSource....

    I have a datasource defined as follows:

    <DataSource ID="someSource" ....>
    <fields>
    ...
    </fields>

    <serverObject className="xxx.AuthorizationDMI" methodName="enforceUserAccess" />

    <operationBindings>
    <operationBinding operationId="takeSnapshot" operationType="custom"
    <serverObject className="xxx.CustomDMI" method="takeSnapshot" />
    </operationBinding>

    <operationBinding operationId="restoreFromSnapshot" operationType="custom"
    <serverObject className="xxx.CustomDMI" method="restoreSnapshot" />
    </operationBinding>

    ....
    <operationBindings>


    The objective is to have all operations go through the server object AuthorizationDMI's enforceUserAccess method, and deny access if the user does not have the appropriate permission to operate on the datasource.

    Everything works, except enforceUserAccess() is only called on the custom operation 'takeSnapshot', but not 'restoreFromSnapshot'.

    My understanding is all operations, either default or custom, should go through the serverObject 'AuthorizationDMI' when it is defined in the scope as listed above. Any idea why it is not triggered all the time?

    #2
    It won't be triggered in either of these cases because only one DMI method is invoked per request.

    Take a look in the QuickStart Guide, Server Framework chapter, for the set of processing phases that a request goes through and places where you could put custom logic. Be sure to read through to the chapter in the reference as well.

    Comment

    Working...
    X