From 5b8f58494e7fb52defe0280b2fa8ea6e038068fb Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Tue, 10 Mar 2009 14:22:22 +0000 Subject: [PATCH] Merged V3.1 to HEAD 12896: Merged DEV/LIVECYCLE-3.1 to V3.1 12859: Merged V2.1-A to DEV/LIVECYCLE-3.1 9040: Fixed WebService client code to take dynamic webapp name 12865: Merged V2.1-A to DEV/LIVECYCLE-3.1 9040 integration: Added 'repository.webapp' (defaults to 'alfresco') for Webservice clients 12868: JAWS-142: Adobe LC JGroups Clustering - JGroups communications and factories remain in 'repository' project - JGroups EHCache integration moved to 'enterpriserepository' project - Default factory for EHCache cluster config is aware of open-enterprise split - Default EHCache config still works as normal - JGroups EHCache config still enabled by setting 'alfresco.cluster.name' property 12887: Merged V2.1-A to DEV\LIVECYCLE-31 8619: Hard-coded "admin" usage in non-test classes only 12906: Re-deleted files after merge mix-up ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V3.1:r12896,12906 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13524 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web-services-application-context.xml | 3 +++ .../AdministrationWebService.java | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/config/alfresco/web-services-application-context.xml b/config/alfresco/web-services-application-context.xml index ccf0005070..c8c9650923 100644 --- a/config/alfresco/web-services-application-context.xml +++ b/config/alfresco/web-services-application-context.xml @@ -218,6 +218,9 @@ + + + diff --git a/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java b/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java index a337cc59de..93da111904 100644 --- a/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java +++ b/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java @@ -46,6 +46,7 @@ import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter; import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.AuthorityService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.service.namespace.QName; import org.alfresco.service.transaction.TransactionService; @@ -77,6 +78,8 @@ public class AdministrationWebService extends AbstractWebService implements /** The authentication service */ private AuthenticationService authenticationService = null; + private AuthorityService authorityService; + /** The transaction service */ private TransactionService transactionService = null; @@ -134,7 +137,17 @@ public class AdministrationWebService extends AbstractWebService implements { this.authenticationService = authenticationService; } - + + /** + * Set the authority service used to determine admin rights. + * + * @param authorityService the service implementation + */ + public void setAuthorityService(AuthorityService authorityService) + { + this.authorityService = authorityService; + } + /** * @see org.alfresco.repo.webservice.administration.AdministrationServiceSoapPort#queryUsers(org.alfresco.repo.webservice.administration.UserFilter) */ @@ -534,7 +547,7 @@ public class AdministrationWebService extends AbstractWebService implements if (this.manageAuthenticationDetails == true) { // Update the authentication details - if (this.authenticationService.getCurrentUserName().equals("admin") == true) + if (this.authorityService.hasAdminAuthority() == true) { this.authenticationService.setAuthentication(userName, newPassword.toCharArray()); }