MNT-16565 : [Site Activities] Group identifier appears instead of group name when changing the group's role

- Fixed activity dashlet display in case of role changed for group.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@128834 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ramona Neamtu
2016-07-20 15:24:53 +00:00
parent 5eccebc6ed
commit 76b6356a41

View File

@@ -2524,18 +2524,23 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
}, AuthenticationUtil.SYSTEM_USER_NAME); }, AuthenticationUtil.SYSTEM_USER_NAME);
AuthorityType authorityType = AuthorityType.getAuthorityType(authorityName);
String authorityDisplayName = authorityName;
if (authorityType == AuthorityType.GROUP)
{
authorityDisplayName = authorityService.getAuthorityDisplayName(authorityName);
}
if (currentRole == null) if (currentRole == null)
{ {
AuthorityType authorityType = AuthorityType.getAuthorityType(authorityName);
if (authorityType == AuthorityType.USER) if (authorityType == AuthorityType.USER)
{ {
activityService.postActivity( activityService.postActivity(
ActivityType.SITE_USER_JOINED, shortName, ActivityType.SITE_USER_JOINED, shortName,
ACTIVITY_TOOL, getActivityUserData(authorityName, role), authorityName); ACTIVITY_TOOL, getActivityUserData(authorityDisplayName, role), authorityName);
} }
else if (authorityType == AuthorityType.GROUP) else if (authorityType == AuthorityType.GROUP)
{ {
String authorityDisplayName = authorityService.getAuthorityDisplayName(authorityName);
activityService.postActivity( activityService.postActivity(
ActivityType.SITE_GROUP_ADDED, shortName, ActivityType.SITE_GROUP_ADDED, shortName,
ACTIVITY_TOOL, getActivityGroupData(authorityDisplayName, role)); ACTIVITY_TOOL, getActivityGroupData(authorityDisplayName, role));
@@ -2543,18 +2548,17 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
} }
else else
{ {
AuthorityType authorityType = AuthorityType.getAuthorityType(authorityName);
if (authorityType == AuthorityType.USER) if (authorityType == AuthorityType.USER)
{ {
activityService.postActivity( activityService.postActivity(
ActivityType.SITE_USER_ROLE_UPDATE, shortName, ActivityType.SITE_USER_ROLE_UPDATE, shortName,
ACTIVITY_TOOL, getActivityUserData(authorityName, role)); ACTIVITY_TOOL, getActivityUserData(authorityDisplayName, role));
} }
else if (authorityType == AuthorityType.GROUP) else if (authorityType == AuthorityType.GROUP)
{ {
activityService.postActivity( activityService.postActivity(
ActivityType.SITE_GROUP_ROLE_UPDATE, shortName, ActivityType.SITE_GROUP_ROLE_UPDATE, shortName,
ACTIVITY_TOOL, getActivityGroupData(authorityName, role)); ACTIVITY_TOOL, getActivityGroupData(authorityDisplayName, role));
} }
} }
} }