diff --git a/config/alfresco/templates/webscripts/org/alfresco/webframework/metadata.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/webframework/metadata.get.html.ftl index 5dcf4efbb0..6cfda27dbe 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/webframework/metadata.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/webframework/metadata.get.html.ftl @@ -48,36 +48,7 @@ , "properties" : { - <#assign first = true> - <#list object.properties?keys as key> - <#if object.properties[key]?exists> - <#assign val = object.properties[key]> - <#if isUser && object.isTemplateContent(val)> - <#if first == false>, - "${key}" : "${jsonUtils.encodeJSONString(val.content)}" - <#assign first = false> - <#elseif object.isTemplateNodeRef(val)> - <#if first == false>, - "${key}" : "${val.nodeRef}" - <#assign first = false> - <#elseif val?is_string == true> - <#if first == false>, - "${key}" : "${jsonUtils.encodeJSONString(val)}" - <#assign first = false> - <#elseif val?is_date == true> - <#if first == false>, - "${key}" : "${val?datetime}" - <#assign first = false> - <#elseif val?is_boolean == true> - <#if first == false>, - "${key}" : "${val?string}" - <#assign first = false> - - - - <#if isUser> - , "isAdmin" : "${isAdmin?string}" - + <@serializeHash hash=object.properties/> } @@ -109,4 +80,44 @@ } +<#if isUser> + , + "capabilities" : + { + <@serializeHash hash=capabilities/> + } + + + + +<#macro serializeHash hash> + +<#local first = true> +<#list hash?keys as key> + <#if hash[key]?exists> + <#local val = hash[key]> + <#if isUser && object.isTemplateContent(val)> + <#if first == false>, + "${key}" : "${jsonUtils.encodeJSONString(val.content)}" + <#local first = false> + <#elseif object.isTemplateNodeRef(val)> + <#if first == false>, + "${key}" : "${val.nodeRef}" + <#local first = false> + <#elseif val?is_string == true> + <#if first == false>, + "${key}" : "${jsonUtils.encodeJSONString(val)}" + <#local first = false> + <#elseif val?is_date == true> + <#if first == false>, + "${key}" : "${val?datetime}" + <#local first = false> + <#elseif val?is_boolean == true> + <#if first == false>, + "${key}" : "${val?string}" + <#local first = false> + + + + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/webframework/metadata.get.js b/config/alfresco/templates/webscripts/org/alfresco/webframework/metadata.get.js index 6372d54457..77a1ec0da6 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/webframework/metadata.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/webframework/metadata.get.js @@ -18,10 +18,9 @@ else if (args["user"] != null) { var userId = args["user"]; object = people.getPerson(userId); - model.isAdmin = people.isAdmin(object); - model.isGuest = people.isGuest(object); - model.isUser = true; + model.isUser = true; model.includeChildren = false; + model.capabilities = people.getCapabilities(object); } // load content by relative path diff --git a/source/java/org/alfresco/repo/web/scripts/LoginTest.java b/source/java/org/alfresco/repo/web/scripts/LoginTest.java index 8ec9484e10..ad1b2714c4 100644 --- a/source/java/org/alfresco/repo/web/scripts/LoginTest.java +++ b/source/java/org/alfresco/repo/web/scripts/LoginTest.java @@ -27,15 +27,15 @@ package org.alfresco.repo.web.scripts; import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; +import org.json.JSONObject; import org.springframework.extensions.webscripts.Status; -import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.DeleteRequest; +import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.PostRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.Response; -import org.json.JSONObject; /** * Junit test for login / logout and validate web scripts @@ -44,7 +44,7 @@ import org.json.JSONObject; */ public class LoginTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; @@ -53,7 +53,7 @@ public class LoginTest extends BaseWebScriptTest protected void setUp() throws Exception { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); diff --git a/source/java/org/alfresco/repo/web/scripts/RepositoryContainerTest.java b/source/java/org/alfresco/repo/web/scripts/RepositoryContainerTest.java index d5d0007096..668b68868e 100644 --- a/source/java/org/alfresco/repo/web/scripts/RepositoryContainerTest.java +++ b/source/java/org/alfresco/repo/web/scripts/RepositoryContainerTest.java @@ -26,7 +26,7 @@ package org.alfresco.repo.web.scripts; import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationUtil; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest; @@ -39,7 +39,7 @@ import org.springframework.extensions.webscripts.TestWebScriptServer.Response; */ public class RepositoryContainerTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private PersonService personService; private static final String USER_ONE = "RunAsOne"; @@ -51,7 +51,7 @@ public class RepositoryContainerTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService) getServer().getApplicationContext().getBean( + this.authenticationService = (MutableAuthenticationService) getServer().getApplicationContext().getBean( "AuthenticationService"); this.personService = (PersonService) getServer().getApplicationContext().getBean("PersonService"); diff --git a/source/java/org/alfresco/repo/web/scripts/activities/feed/control/FeedControlTest.java b/source/java/org/alfresco/repo/web/scripts/activities/feed/control/FeedControlTest.java index 0ca95fa626..aec2c3d8fb 100644 --- a/source/java/org/alfresco/repo/web/scripts/activities/feed/control/FeedControlTest.java +++ b/source/java/org/alfresco/repo/web/scripts/activities/feed/control/FeedControlTest.java @@ -28,7 +28,7 @@ import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; import org.springframework.extensions.webscripts.TestWebScriptServer.DeleteRequest; @@ -49,7 +49,7 @@ public class FeedControlTest extends BaseWebScriptTest { private static Log logger = LogFactory.getLog(FeedControlTest.class); - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; @@ -67,7 +67,7 @@ public class FeedControlTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); diff --git a/source/java/org/alfresco/repo/web/scripts/blog/BlogServiceTest.java b/source/java/org/alfresco/repo/web/scripts/blog/BlogServiceTest.java index 1dc85c08b5..e1d9bf6405 100644 --- a/source/java/org/alfresco/repo/web/scripts/blog/BlogServiceTest.java +++ b/source/java/org/alfresco/repo/web/scripts/blog/BlogServiceTest.java @@ -33,7 +33,7 @@ import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.site.SiteModel; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.service.cmr.site.SiteInfo; import org.alfresco.service.cmr.site.SiteService; @@ -59,7 +59,7 @@ public class BlogServiceTest extends BaseWebScriptTest @SuppressWarnings("unused") private static Log logger = LogFactory.getLog(BlogServiceTest.class); - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; private SiteService siteService; @@ -83,7 +83,7 @@ public class BlogServiceTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService"); diff --git a/source/java/org/alfresco/repo/web/scripts/discussion/DiscussionServiceTest.java b/source/java/org/alfresco/repo/web/scripts/discussion/DiscussionServiceTest.java index a7c2ddf057..a01339c9fe 100644 --- a/source/java/org/alfresco/repo/web/scripts/discussion/DiscussionServiceTest.java +++ b/source/java/org/alfresco/repo/web/scripts/discussion/DiscussionServiceTest.java @@ -32,7 +32,7 @@ import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.site.SiteModel; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.service.cmr.site.SiteInfo; import org.alfresco.service.cmr.site.SiteService; @@ -55,7 +55,7 @@ public class DiscussionServiceTest extends BaseWebScriptTest { private static Log logger = LogFactory.getLog(DiscussionServiceTest.class); - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; private SiteService siteService; @@ -78,7 +78,7 @@ public class DiscussionServiceTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService"); diff --git a/source/java/org/alfresco/repo/web/scripts/groups/GroupsTest.java b/source/java/org/alfresco/repo/web/scripts/groups/GroupsTest.java index fa43c91ace..df698410a1 100644 --- a/source/java/org/alfresco/repo/web/scripts/groups/GroupsTest.java +++ b/source/java/org/alfresco/repo/web/scripts/groups/GroupsTest.java @@ -32,9 +32,9 @@ import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; import org.alfresco.service.cmr.security.AuthorityService; import org.alfresco.service.cmr.security.AuthorityType; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; import org.springframework.extensions.webscripts.Status; @@ -60,7 +60,7 @@ public class GroupsTest extends BaseWebScriptTest { private static final Log logger = LogFactory.getLog(BaseWebScriptTest.class); - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthorityService authorityService; private AuthenticationComponent authenticationComponent; private PersonService personService; @@ -142,7 +142,7 @@ public class GroupsTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); this.authorityService = (AuthorityService)getServer().getApplicationContext().getBean("AuthorityService"); diff --git a/source/java/org/alfresco/repo/web/scripts/invitation/InvitationTest.java b/source/java/org/alfresco/repo/web/scripts/invitation/InvitationTest.java index 144d4b6fb0..5567ea243a 100644 --- a/source/java/org/alfresco/repo/web/scripts/invitation/InvitationTest.java +++ b/source/java/org/alfresco/repo/web/scripts/invitation/InvitationTest.java @@ -24,37 +24,27 @@ */ package org.alfresco.repo.web.scripts.invitation; -import java.io.Serializable; import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; import java.util.List; -import java.util.Map; -import java.util.Set; import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.site.SiteModel; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; -import org.alfresco.service.cmr.site.SiteInfo; import org.alfresco.service.cmr.site.SiteService; import org.alfresco.service.cmr.site.SiteVisibility; -import org.alfresco.service.namespace.QName; import org.alfresco.util.GUID; import org.alfresco.util.PropertyMap; -import org.springframework.extensions.webscripts.Status; +import org.json.JSONArray; +import org.json.JSONObject; import org.springframework.extensions.webscripts.TestWebScriptServer.DeleteRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.PostRequest; -import org.springframework.extensions.webscripts.TestWebScriptServer.PutRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.Response; -import org.json.JSONArray; -import org.json.JSONObject; /** * Unit test of Invitation REST API. @@ -65,7 +55,7 @@ import org.json.JSONObject; */ public class InvitationTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; private SiteService siteService; @@ -98,7 +88,7 @@ public class InvitationTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService"); diff --git a/source/java/org/alfresco/repo/web/scripts/invite/InviteServiceTest.java b/source/java/org/alfresco/repo/web/scripts/invite/InviteServiceTest.java index 69b58018bb..cb7ec8bffc 100644 --- a/source/java/org/alfresco/repo/web/scripts/invite/InviteServiceTest.java +++ b/source/java/org/alfresco/repo/web/scripts/invite/InviteServiceTest.java @@ -42,9 +42,9 @@ import org.alfresco.repo.web.scripts.BaseWebScriptTest; 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.AuthorityType; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.service.cmr.site.SiteInfo; import org.alfresco.service.cmr.site.SiteService; @@ -74,7 +74,7 @@ public class InviteServiceTest extends BaseWebScriptTest { // member variables for service instances private AuthorityService authorityService; - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; private SiteService siteService; @@ -123,7 +123,7 @@ public class InviteServiceTest extends BaseWebScriptTest // get references to services this.authorityService = (AuthorityService) getServer().getApplicationContext().getBean("AuthorityService"); - this.authenticationService = (AuthenticationService) getServer().getApplicationContext() + this.authenticationService = (MutableAuthenticationService) getServer().getApplicationContext() .getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent) getServer().getApplicationContext() .getBean("AuthenticationComponent"); diff --git a/source/java/org/alfresco/repo/web/scripts/person/ChangePasswordPost.java b/source/java/org/alfresco/repo/web/scripts/person/ChangePasswordPost.java index 5b43983115..d83a884b8d 100644 --- a/source/java/org/alfresco/repo/web/scripts/person/ChangePasswordPost.java +++ b/source/java/org/alfresco/repo/web/scripts/person/ChangePasswordPost.java @@ -29,15 +29,15 @@ import java.util.HashMap; import java.util.Map; import org.alfresco.repo.security.authentication.AuthenticationException; -import org.alfresco.service.cmr.security.AuthenticationService; import org.alfresco.service.cmr.security.AuthorityService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; +import org.json.JSONException; +import org.json.JSONObject; import org.springframework.extensions.surf.util.Content; import org.springframework.extensions.webscripts.DeclarativeWebScript; import org.springframework.extensions.webscripts.Status; import org.springframework.extensions.webscripts.WebScriptException; import org.springframework.extensions.webscripts.WebScriptRequest; -import org.json.JSONException; -import org.json.JSONObject; /** * Webscript implementation for the POST method for 'changepassword' API. @@ -48,14 +48,14 @@ public class ChangePasswordPost extends DeclarativeWebScript { private static final String PARAM_NEWPW = "newpw"; private static final String PARAM_OLDPW = "oldpw"; - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthorityService authorityService; /** * @param authenticationService the AuthenticationService to set */ - public void setAuthenticationService(AuthenticationService authenticationService) + public void setAuthenticationService(MutableAuthenticationService authenticationService) { this.authenticationService = authenticationService; } diff --git a/source/java/org/alfresco/repo/web/scripts/person/PersonServiceTest.java b/source/java/org/alfresco/repo/web/scripts/person/PersonServiceTest.java index 64fa51dd6c..5b0f0a1704 100644 --- a/source/java/org/alfresco/repo/web/scripts/person/PersonServiceTest.java +++ b/source/java/org/alfresco/repo/web/scripts/person/PersonServiceTest.java @@ -30,7 +30,7 @@ import java.util.List; import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; import org.springframework.extensions.webscripts.Status; @@ -49,7 +49,7 @@ import org.json.JSONObject; */ public class PersonServiceTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; @@ -66,7 +66,7 @@ public class PersonServiceTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); diff --git a/source/java/org/alfresco/repo/web/scripts/preference/PreferenceServiceTest.java b/source/java/org/alfresco/repo/web/scripts/preference/PreferenceServiceTest.java index e158806ba4..67f9b150e6 100644 --- a/source/java/org/alfresco/repo/web/scripts/preference/PreferenceServiceTest.java +++ b/source/java/org/alfresco/repo/web/scripts/preference/PreferenceServiceTest.java @@ -28,7 +28,7 @@ import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest; @@ -45,7 +45,7 @@ import org.json.JSONObject; */ public class PreferenceServiceTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; @@ -59,7 +59,7 @@ public class PreferenceServiceTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); diff --git a/source/java/org/alfresco/repo/web/scripts/search/PersonSearchTest.java b/source/java/org/alfresco/repo/web/scripts/search/PersonSearchTest.java index fd69672e2b..9dc6db00dc 100644 --- a/source/java/org/alfresco/repo/web/scripts/search/PersonSearchTest.java +++ b/source/java/org/alfresco/repo/web/scripts/search/PersonSearchTest.java @@ -28,8 +28,8 @@ import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; import org.alfresco.service.cmr.security.AuthorityService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; import org.springframework.extensions.webscripts.Status; @@ -44,7 +44,7 @@ import org.springframework.extensions.webscripts.TestWebScriptServer.Response; */ public class PersonSearchTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; private AuthorityService authorityService; @@ -58,7 +58,7 @@ public class PersonSearchTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); this.authorityService = (AuthorityService)getServer().getApplicationContext().getBean("AuthorityService"); diff --git a/source/java/org/alfresco/repo/web/scripts/site/SiteServiceTest.java b/source/java/org/alfresco/repo/web/scripts/site/SiteServiceTest.java index f48631ad66..847870abc8 100644 --- a/source/java/org/alfresco/repo/web/scripts/site/SiteServiceTest.java +++ b/source/java/org/alfresco/repo/web/scripts/site/SiteServiceTest.java @@ -39,9 +39,9 @@ import org.alfresco.repo.site.SiteModel; import org.alfresco.repo.web.scripts.BaseWebScriptTest; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; -import org.alfresco.service.cmr.security.AuthenticationService; import org.alfresco.service.cmr.security.AuthorityService; import org.alfresco.service.cmr.security.AuthorityType; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.service.cmr.site.SiteInfo; import org.alfresco.service.cmr.site.SiteService; @@ -65,7 +65,7 @@ import org.json.JSONObject; */ public class SiteServiceTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; private SiteService siteService; @@ -87,7 +87,7 @@ public class SiteServiceTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService"); diff --git a/source/java/org/alfresco/repo/web/scripts/tagging/TaggingServiceTest.java b/source/java/org/alfresco/repo/web/scripts/tagging/TaggingServiceTest.java index 18938207c0..03678a7069 100644 --- a/source/java/org/alfresco/repo/web/scripts/tagging/TaggingServiceTest.java +++ b/source/java/org/alfresco/repo/web/scripts/tagging/TaggingServiceTest.java @@ -33,7 +33,7 @@ import org.alfresco.service.cmr.model.FileFolderService; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.StoreRef; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.service.cmr.tagging.TaggingService; import org.alfresco.util.GUID; @@ -49,7 +49,7 @@ import org.json.JSONArray; */ public class TaggingServiceTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; private TaggingService taggingService; @@ -73,7 +73,7 @@ public class TaggingServiceTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); this.taggingService = (TaggingService)getServer().getApplicationContext().getBean("TaggingService"); diff --git a/source/java/org/alfresco/repo/web/scripts/wcm/WebProjectTest.java b/source/java/org/alfresco/repo/web/scripts/wcm/WebProjectTest.java index 503825b9e0..eefadfe6b0 100644 --- a/source/java/org/alfresco/repo/web/scripts/wcm/WebProjectTest.java +++ b/source/java/org/alfresco/repo/web/scripts/wcm/WebProjectTest.java @@ -31,7 +31,7 @@ import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; import org.springframework.extensions.webscripts.Status; @@ -50,7 +50,7 @@ import org.json.JSONObject; */ public class WebProjectTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; @@ -77,7 +77,7 @@ public class WebProjectTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); diff --git a/source/java/org/alfresco/repo/web/scripts/wcm/membership/WebProjectMembershipTest.java b/source/java/org/alfresco/repo/web/scripts/wcm/membership/WebProjectMembershipTest.java index 567313213c..33b0672b88 100644 --- a/source/java/org/alfresco/repo/web/scripts/wcm/membership/WebProjectMembershipTest.java +++ b/source/java/org/alfresco/repo/web/scripts/wcm/membership/WebProjectMembershipTest.java @@ -31,7 +31,7 @@ import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; import org.springframework.extensions.webscripts.Status; @@ -49,7 +49,7 @@ import org.json.JSONObject; */ public class WebProjectMembershipTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; @@ -77,7 +77,7 @@ public class WebProjectMembershipTest extends BaseWebScriptTest { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); diff --git a/source/java/org/alfresco/repo/web/scripts/wcm/sandbox/AssetTest.java b/source/java/org/alfresco/repo/web/scripts/wcm/sandbox/AssetTest.java index a2dc1a6da1..19bf9212b8 100644 --- a/source/java/org/alfresco/repo/web/scripts/wcm/sandbox/AssetTest.java +++ b/source/java/org/alfresco/repo/web/scripts/wcm/sandbox/AssetTest.java @@ -33,7 +33,7 @@ import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.util.PropertyMap; import org.json.JSONArray; @@ -50,7 +50,7 @@ import org.springframework.extensions.webscripts.TestWebScriptServer.Response; */ public class AssetTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; @@ -88,7 +88,7 @@ public class AssetTest extends BaseWebScriptTest { setCustomContext(SUBMIT_CONFIG_LOCATION); super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); diff --git a/source/java/org/alfresco/repo/web/scripts/wcm/sandbox/SandboxTest.java b/source/java/org/alfresco/repo/web/scripts/wcm/sandbox/SandboxTest.java index 397cf2ab0d..5e2202064d 100644 --- a/source/java/org/alfresco/repo/web/scripts/wcm/sandbox/SandboxTest.java +++ b/source/java/org/alfresco/repo/web/scripts/wcm/sandbox/SandboxTest.java @@ -33,7 +33,7 @@ import org.alfresco.model.ContentModel; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.web.scripts.BaseWebScriptTest; -import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.springframework.extensions.surf.util.ISO8601DateFormat; import org.alfresco.util.PropertyMap; @@ -52,7 +52,7 @@ import org.json.JSONObject; */ public class SandboxTest extends BaseWebScriptTest { - private AuthenticationService authenticationService; + private MutableAuthenticationService authenticationService; private AuthenticationComponent authenticationComponent; private PersonService personService; @@ -80,7 +80,7 @@ public class SandboxTest extends BaseWebScriptTest { { super.setUp(); - this.authenticationService = (AuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); + this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService"); this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent"); this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService"); diff --git a/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java b/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java index 6ed1e415ea..384e3fbfad 100644 --- a/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java +++ b/source/java/org/alfresco/repo/webservice/administration/AdministrationWebService.java @@ -45,8 +45,8 @@ import org.alfresco.repo.webservice.types.NamedValue; 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.MutableAuthenticationService; import org.alfresco.service.cmr.security.PersonService; import org.alfresco.service.namespace.QName; import org.alfresco.service.transaction.TransactionService; @@ -76,7 +76,7 @@ public class AdministrationWebService extends AbstractWebService implements private boolean manageAuthenticationDetails = true; /** The authentication service */ - private AuthenticationService authenticationService = null; + private MutableAuthenticationService authenticationService = null; private AuthorityService authorityService; @@ -133,7 +133,7 @@ public class AdministrationWebService extends AbstractWebService implements * * @param authenticationService the authentication service */ - public void setAuthenticationService(AuthenticationService authenticationService) + public void setAuthenticationService(MutableAuthenticationService authenticationService) { this.authenticationService = authenticationService; }