mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
97693: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud) 97683: Merged 5.0.1 (5.0.1) to 5.0.N (5.0.2) 97651: Merged DEV to PATCHES/5.0.1 (5.0.1) 97532 : MNT-13418 : When performing upgrade with a tenant, patch.siteAdministrators and patch.alfrescoSearchAdministrators throw an error - Using AuthenticationUtils to get administrator's username git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@97705 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,6 +22,7 @@ package org.alfresco.repo.admin.patch.impl;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.admin.patch.AbstractPatch;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
@@ -76,13 +77,8 @@ public class AddGroupAuthorityPatch extends AbstractPatch
|
||||
this.groupAuthorityDetails.groupDisplayName,
|
||||
this.groupAuthorityDetails.authorityZones);
|
||||
|
||||
if (this.groupAuthorityDetails.adminUserName != null
|
||||
&& authorityService.isAdminAuthority(this.groupAuthorityDetails.adminUserName))
|
||||
{
|
||||
// Add admin as a member of the created group
|
||||
authorityService.addAuthority(groupAuthorityName,
|
||||
this.groupAuthorityDetails.adminUserName);
|
||||
}
|
||||
authorityService.addAuthority(groupAuthorityName, AuthenticationUtil.getAdminUserName());
|
||||
|
||||
result.append(I18NUtil.getMessage(MSG_RESULT, groupAuthorityName));
|
||||
|
||||
return result.toString();
|
||||
@@ -97,7 +93,6 @@ public class AddGroupAuthorityPatch extends AbstractPatch
|
||||
{
|
||||
private String groupName;
|
||||
private String groupDisplayName;
|
||||
private String adminUserName;
|
||||
private Set<String> authorityZones;
|
||||
|
||||
/**
|
||||
@@ -116,17 +111,6 @@ public class AddGroupAuthorityPatch extends AbstractPatch
|
||||
this.groupDisplayName = groupDisplayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Admin's username, so it can be included as a member of the
|
||||
* group. If null, an empty group will be created.
|
||||
*
|
||||
* @param adminUserName the adminUserName to set
|
||||
*/
|
||||
public void setAdminUserName(String adminUserName)
|
||||
{
|
||||
this.adminUserName = adminUserName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param authorityZones the authorityZones to set
|
||||
*/
|
||||
|
Reference in New Issue
Block a user