No result when Rally.data.WsapiDataStore lacks permissions

Posted by user1195996 on Stack Overflow See other posts from Stack Overflow or by user1195996
Published on 2012-09-05T22:07:08Z Indexed on 2012/09/11 3:38 UTC
Read the original article Hit count: 140

Filed under:

I'm calling Ext.create('Rally.data.WsapiDataStore', params), and looking for results with the load event.

I'm requesting a number of objects across programs that the user may or may not have read permission for.

This works fine for queries where the user has permissions. But in the case where the user does not have permission and presumably gets zero results back, the load event does not seem to fire at all. I would expect it to fire with the unsuccessful flag or else to return with empty results.

Since I don't know that the request has failed, my program waits and waits. How can I tell if a this request fails to return because of security?

BTW, looking at the network stats, I believe all my requests get a "200 OK" status back.

Here is the method I use to create the various data stores:

_createDataStore: function(params) {
    this.openRequests++;

    var createParams = {
        model: params.type,
        autoLoad: true,

        // So I can later determine which query type it is, and which program
        requestType:    params.requestType == undefined ? params.type : params.requestType,
        program:        this.program,

        listeners: {
            load: this._onDataLoaded,
            scope: this
        },
        filters: params.filters,
        pageSize: params.pageSize,
        fetch: params.fetch,

        context:    {
            project: this.project,
            projectScopeUp: false,
            projectScopeDown: true
        },
        pageSize:   1 // We only need the count
    };
    console.log('_createDataStore', this.program, createParams.requestType);

    Ext.create('Rally.data.WsapiDataStore', createParams);
},

And here is the _onDataLoaded method:

_onDataLoaded: function(store, data, successB) {
    console.log('_onDataLoaded', this.program, successB);
    ...

I only see this function called for those queries for which the account has permissions.

© Stack Overflow or respective owner

Related posts about rally