-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.3.2 CE GA3
-
Fix Version/s: 7.0.0 DXP FP94, 7.0.10.15 DXP SP15, 7.1.10 DXP FP19, 7.1.10.5 SP5, 7.2.10 DXP FP7, Master
-
Branch Version/s:7.3.x
-
Backported to Branch:Committed
-
Fix Priority:3
-
Git Pull Request:
UserLocalService/UserLocalServiceUtil provides two methods to add a role:
Role addRole(long userId, String className, long classPK, String name, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, int type, String subtype, ServiceContext serviceContext)
and
addRole(Role role)
But these two methods behave differently.
addRole(role) just adds the role to the database, but the method with multiple parameters also calls resourceLocalService.addResources(...) and possible reindexes.
See:
Basically, it is an error to create a role using createRole + addRole(role), because then the resource is missing and you won't see the role in the control panel.