Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
7.3.2 CE GA3
-
7.3.x
-
Committed
-
3
Description
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.