ALF-8832 - MT: fix feed email notification

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28378 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2011-06-14 09:02:53 +00:00
parent d9e98c1b16
commit 6e9bc38db9

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2005-2010 Alfresco Software Limited. * Copyright (C) 2005-2011 Alfresco Software Limited.
* *
* This file is part of Alfresco * This file is part of Alfresco
* *
@@ -212,9 +212,9 @@ public class ActivityServiceImpl implements ActivityService, InitializingBean
String currentUser = getCurrentUser(); String currentUser = getCurrentUser();
if (! ((currentUser == null) || if (! ((currentUser == null) ||
(currentUser.equals(AuthenticationUtil.getSystemUserName())) ||
(authorityService.isAdminAuthority(currentUser)) || (authorityService.isAdminAuthority(currentUser)) ||
(currentUser.equals(feedUserId)))) (currentUser.equals(feedUserId)) ||
(AuthenticationUtil.getSystemUserName().equals(this.tenantService.getBaseNameUser(currentUser)))))
{ {
throw new AccessDeniedException("Unable to get user feed entries for '" + feedUserId + "' - currently logged in as '" + currentUser +"'"); throw new AccessDeniedException("Unable to get user feed entries for '" + feedUserId + "' - currently logged in as '" + currentUser +"'");
} }
@@ -353,7 +353,10 @@ public class ActivityServiceImpl implements ActivityService, InitializingBean
String currentUser = getCurrentUser(); String currentUser = getCurrentUser();
if ((currentUser == null) || ((! currentUser.equals(AuthenticationUtil.getSystemUserName())) && (! currentUser.equals(userId)) && (! authorityService.isAdminAuthority(currentUser)))) if ((currentUser == null) ||
(! ((authorityService.isAdminAuthority(currentUser)) ||
(currentUser.equals(userId)) ||
(AuthenticationUtil.getSystemUserName().equals(this.tenantService.getBaseNameUser(currentUser))))))
{ {
throw new AlfrescoRuntimeException("Current user " + currentUser + " is not permitted to get feed controls for " + userId); throw new AlfrescoRuntimeException("Current user " + currentUser + " is not permitted to get feed controls for " + userId);
} }
@@ -435,7 +438,9 @@ public class ActivityServiceImpl implements ActivityService, InitializingBean
private String getCurrentUser() private String getCurrentUser()
{ {
String userId = AuthenticationUtil.getFullyAuthenticatedUser(); String userId = AuthenticationUtil.getFullyAuthenticatedUser();
if ((userId != null) && (! userId.equals(AuthenticationUtil.SYSTEM_USER_NAME)) && (! userNamesAreCaseSensitive)) if ((userId != null) &&
(! userNamesAreCaseSensitive) &&
(! AuthenticationUtil.getSystemUserName().equals(this.tenantService.getBaseNameUser(userId))))
{ {
// user names are not case-sensitive // user names are not case-sensitive
userId = userId.toLowerCase(); userId = userId.toLowerCase();