mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged mward/5.2.n-repo1544-update-self (5.2.1) to 5.2.N (5.2.1)
132966 mward: REPO-1544: replaced use of unprotected person service with runAsSystem (review: CR-620) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133000 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -626,7 +626,6 @@
|
|||||||
<property name="siteService" ref="SiteService" />
|
<property name="siteService" ref="SiteService" />
|
||||||
<property name="nodeService" ref="NodeService" />
|
<property name="nodeService" ref="NodeService" />
|
||||||
<property name="personService" ref="PersonService" />
|
<property name="personService" ref="PersonService" />
|
||||||
<property name="unprotectedPersonService" ref="personService" />
|
|
||||||
<property name="authenticationService" ref="AuthenticationService" />
|
<property name="authenticationService" ref="AuthenticationService" />
|
||||||
<property name="authorityService" ref="AuthorityService" />
|
<property name="authorityService" ref="AuthorityService" />
|
||||||
<property name="contentUsageService" ref="contentUsageImpl" />
|
<property name="contentUsageService" ref="contentUsageImpl" />
|
||||||
|
@@ -104,7 +104,6 @@ public class PeopleImpl implements People
|
|||||||
protected SiteService siteService;
|
protected SiteService siteService;
|
||||||
protected NodeService nodeService;
|
protected NodeService nodeService;
|
||||||
protected PersonService personService;
|
protected PersonService personService;
|
||||||
protected PersonService unprotectedPersonService;
|
|
||||||
protected AuthenticationService authenticationService;
|
protected AuthenticationService authenticationService;
|
||||||
protected AuthorityService authorityService;
|
protected AuthorityService authorityService;
|
||||||
protected ContentUsageService contentUsageService;
|
protected ContentUsageService contentUsageService;
|
||||||
@@ -146,11 +145,6 @@ public class PeopleImpl implements People
|
|||||||
this.personService = personService;
|
this.personService = personService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUnprotectedPersonService(PersonService unprotectedPersonService)
|
|
||||||
{
|
|
||||||
this.unprotectedPersonService = unprotectedPersonService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthenticationService(AuthenticationService authenticationService)
|
public void setAuthenticationService(AuthenticationService authenticationService)
|
||||||
{
|
{
|
||||||
this.authenticationService = authenticationService;
|
this.authenticationService = authenticationService;
|
||||||
@@ -583,16 +577,17 @@ public class PeopleImpl implements People
|
|||||||
Map<String, Object> customProps = person.getProperties();
|
Map<String, Object> customProps = person.getProperties();
|
||||||
properties.putAll(nodes.mapToNodeProperties(customProps));
|
properties.putAll(nodes.mapToNodeProperties(customProps));
|
||||||
}
|
}
|
||||||
|
|
||||||
// The person service only allows admin users to set the properties by default.
|
// The person service only allows admin users to set the properties by default.
|
||||||
if (!isAdminAuthority())
|
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||||
{
|
{
|
||||||
unprotectedPersonService.setPersonProperties(personIdToUpdate, properties, false);
|
@Override
|
||||||
}
|
public Void doWork() throws Exception
|
||||||
else
|
{
|
||||||
{
|
personService.setPersonProperties(personIdToUpdate, properties, false);
|
||||||
personService.setPersonProperties(personIdToUpdate, properties, false);
|
return null;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Update custom aspects
|
// Update custom aspects
|
||||||
nodes.updateCustomAspects(personNodeRef, person.getAspectNames(), EXCLUDED_ASPECTS);
|
nodes.updateCustomAspects(personNodeRef, person.getAspectNames(), EXCLUDED_ASPECTS);
|
||||||
|
Reference in New Issue
Block a user