diff --git a/config/alfresco/patch/patch-services-context.xml b/config/alfresco/patch/patch-services-context.xml
index e3e26a0ae6..d32129b163 100644
--- a/config/alfresco/patch/patch-services-context.xml
+++ b/config/alfresco/patch/patch-services-context.xml
@@ -920,9 +920,6 @@
SITE_ADMINISTRATORS
-
- ${alfresco_user_store.adminusername}
-
APP.DEFAULT
@@ -955,9 +952,6 @@
ALFRESCO_SEARCH_ADMINISTRATORS
-
- ${alfresco_user_store.adminusername}
-
APP.DEFAULT
diff --git a/source/java/org/alfresco/repo/admin/patch/impl/AddGroupAuthorityPatch.java b/source/java/org/alfresco/repo/admin/patch/impl/AddGroupAuthorityPatch.java
index fbea9e773c..4203511d01 100644
--- a/source/java/org/alfresco/repo/admin/patch/impl/AddGroupAuthorityPatch.java
+++ b/source/java/org/alfresco/repo/admin/patch/impl/AddGroupAuthorityPatch.java
@@ -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 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
*/