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

          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.

            People

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

              Dates

              • Created:
                Updated: