Merged V3.0 to HEAD

12178: Authenticate now required since introduction of public service usage in 3.0 test and authentication util changes.
  12180: Build fix for updating person properties - set all existing to keep quota properties.
  12187: MT - fix missing merge and fallout post authentication util changes
  12199: Usage Service - fix unit test fallout post authentication util changes
  12204: Authenticate now required since introduction of public service usage in 3.0 test and authentication util changes
  12206: Authenticate now required since authentication util changes
  12210: Module fixes - to use new authentication util api changes


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12515 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-12-19 13:22:28 +00:00
parent ecf18f2bb4
commit 90d1f80fce
7 changed files with 87 additions and 101 deletions

View File

@@ -32,8 +32,8 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.node.NodeServicePolicies;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.AuthorityService;
import org.alfresco.service.cmr.usage.ContentUsageService;
import org.alfresco.service.namespace.NamespaceService;
@@ -46,7 +46,6 @@ import org.alfresco.service.namespace.QName;
public class UsageQuotaProtector implements NodeServicePolicies.OnUpdatePropertiesPolicy
{
private AuthorityService authorityService;
private AuthenticationService authenticationService;
private PolicyComponent policyComponent;
private ContentUsageService contentUsageService;
@@ -55,11 +54,6 @@ public class UsageQuotaProtector implements NodeServicePolicies.OnUpdateProperti
this.authorityService = authorityService;
}
public void setAuthenticationService(AuthenticationService authenticationService)
{
this.authenticationService = authenticationService;
}
public void setContentUsageService(ContentUsageService contentUsageService)
{
this.contentUsageService = contentUsageService;
@@ -105,14 +99,14 @@ public class UsageQuotaProtector implements NodeServicePolicies.OnUpdateProperti
// Check for change in sizeCurrent
if ((sizeCurrentBefore != sizeCurrentAfter) && (sizeCurrentBefore != null) &&
(! (authorityService.hasAdminAuthority() || authenticationService.isCurrentUserTheSystemUser())))
(! (authorityService.hasAdminAuthority() || AuthenticationUtil.isRunAsUserTheSystemUser())))
{
throw new AlfrescoRuntimeException("Update failed: protected property 'sizeCurrent'");
}
// Check for change in sizeQuota
if ((sizeQuotaBefore != sizeQuotaAfter) && (sizeQuotaBefore != null) &&
(! (authorityService.hasAdminAuthority() || authenticationService.isCurrentUserTheSystemUser())))
(! (authorityService.hasAdminAuthority() || AuthenticationUtil.isRunAsUserTheSystemUser())))
{
throw new AlfrescoRuntimeException("Update failed: protected property 'sizeQuota'");
}