Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-9360

Align "returnByDefault" behavior between roles and effectiveRoles


    • Target Version/s:
    • Verified Version/s:
    • Story Points:
    • Sprint:
      OpenIDM Sprint 6.5-2, OpenIDM Sprint 6.5-3, OpenIDM Sprint 6.5-4, OpenIDM Sprint 6.5-5
    • Support Ticket IDs:


      The "returnByDefault" property is intended to be used to express which relationship and virtual properties should and should not be returned in a request without having to be explicitly named in the "_fields" list for the request. The reason why this distinction is necessary is because of the concern over the extra cost associated with producing these values in contexts which they are not needed. For example, a query for managed/user used to authenticate does not need the values from the "roles" property, and so those values should not be queried from the database.

      For this reason, the schema for managed/user defines "roles" with "returnByDefault": false. However, it also defines "effectiveRoles" with "returnByDefault": true. Since the default script implement of "effectiveRoles" is dependent on "roles" for its calculation, this will indirectly cause the roles for each user to be fetched, despite the "returnByDefault": false for roles.

      Once OPENIDM-8331 is completed, the work needed to fetch roles (or any requested relationship) should be much more efficient. However if the schema for roles and effectiveRoles remained unchanged, this work would not benefit the calculation of roles. This is due to the fact that roles wouldn't be specifically named in the request, and so it would be omitted in the query sent to the repo that is capable of more efficient relationship traversal.

      The "returnByDefault" value for "roles" should be changed to true so that it can benefit from the work done in OPENIDM-8331 . The original concern regarding performance of fetching this value with each request should be mitigated by that query behavior.


          Issue Links



              • Assignee:
                whitney.hunter Whitney Hunter [X] (Inactive)
                jake.feasel Jake Feasel
                QA Assignee:
                Tinghua Xu
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created: