Issue Bug Closed

#99614Category tree only shows first category in records categories tab if permission category is only checked for first level

Florian Rival 01/18/23, 15:06 updated 07/23/24, 08:06

Description

How to reproduce :

  1. Add a category with sub-categories
  2. Create a backend user group and set ‘category_perms’ with only first category checked (see capture)
  3. Add this group to a non-admin user
  4. Edit a record with ‘categories’ tab allowed

You should see the selected category and the sub-categories but instead, you only see the selected category (see capture).

If the category checked in the ‘category_perms’ of the user group is at a second level, it works as expected.

Probable cause

It’s because in file CategoryPermissionsAspect::addUserPermissionsToCategoryTreeData() , when method lookUpCategoryMountPointInTreeNodes() is called, it looks only for category mount point in subcategories, first category is ignored and subcategories are never added to tree.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.