Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29962

As a Developer I want API to detect if object is user/group

    Details

      Description

      To be able to avoid expensive uncached API calls in Admin UI to always have to load to see if a object is User or User Group, simply expose isUser() and isUserGroup() APIs on UserService to avoid this (as it can check against config instead).

        Issue Links

          Activity

          André Rømcke created issue -
          André Rømcke made changes -
          Field Original Value New Value
          Link This issue clones EZP-29821 [ EZP-29821 ]
          André Rømcke made changes -
          Description Some minor optimizations ot Admin UI by identifying things to improve.

          A mix:
          - Exposing a few smaller helper methods in API to make Admin UI more efficient
          - Add missing + improve SPI caching of some methods Admin UI uses a lot
          - Refactor a few things in Admin UI to avoid API lookups
          To be able to avoid expensive uncached API calls in Admin UI to always have to load to see if a object is User or User Group, simply expose isUser() and isUserGroup() APIs on UserService to avoid this (as it can check against config instead).
          André Rømcke made changes -
          Summary As a Developer I want less API to detect if object is user or user group As a Developer I want lAPI to detect if object is user/group
          André Rømcke made changes -
          Summary As a Developer I want lAPI to detect if object is user/group As a Developer I want API to detect if object is user/group
          André Rømcke made changes -
          Status Backlog [ 10000 ] Specification [ 10002 ]
          André Rømcke made changes -
          Status Specification [ 10002 ] Specification Done [ 10003 ]
          Assignee André Rømcke [ andre.romcke@ez.no ]
          André Rømcke made changes -
          Fix Version/s 2.4.0 [ 15091 ]
          Fix Version/s 2.4.0-beta1 [ 15089 ]
          André Rømcke made changes -
          Status Specification Done [ 10003 ] Development [ 3 ]
          Assignee André Rømcke [ andre.romcke@ez.no ]
          Hide
          André Rømcke added a comment -

          Merged: https://github.com/ezsystems/ezpublish-kernel/commit/f2aec63b4b788570220ea2d956515e461d3135ad

          Exposes two small API's on UserService:

          • isUser(Content $content): bool
          • isUserGroup(Content $content): bool

          This is done in order to avoid expensive usage of loadUser() and loadUserGroup in several cases in Admin UI and maybe also elsewhere in order to detect if a content item is user / user group or not (with try catch..).

          So this will allow further optimizations to be done in 2.4.1 / 2.5 in Admin UI.

          Show
          André Rømcke added a comment - Merged: https://github.com/ezsystems/ezpublish-kernel/commit/f2aec63b4b788570220ea2d956515e461d3135ad Exposes two small API's on UserService: isUser(Content $content): bool isUserGroup(Content $content): bool This is done in order to avoid expensive usage of loadUser() and loadUserGroup in several cases in Admin UI and maybe also elsewhere in order to detect if a content item is user / user group or not (with try catch..) . So this will allow further optimizations to be done in 2.4.1 / 2.5 in Admin UI.
          André Rømcke made changes -
          Status Development [ 3 ] Development Done [ 5 ]
          Dominika Kurek made changes -
          Status Development Done [ 5 ] QA [ 10008 ]
          André Rømcke made changes -
          Assignee André Rømcke [ andre.romcke@ez.no ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Backlog Backlog Specification Specification
          1h 56m 1 André Rømcke 21/Dec/18 1:24 PM
          Specification Specification Specification Done Specification Done
          8s 1 André Rømcke 21/Dec/18 1:24 PM
          Specification Done Specification Done Development Development
          11s 1 André Rømcke 21/Dec/18 1:25 PM
          Development Development Development Done Development Done
          2m 35s 1 André Rømcke 21/Dec/18 1:27 PM
          Development Done Development Done QA QA
          11d 20h 1 Dominika Kurek 02/Jan/19 9:28 AM

            People

            • Assignee:
              Unassigned
              Reporter:
              André Rømcke
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: