DM Usages/Quotas fix

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7528 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2007-12-04 16:15:43 +00:00
parent 54a6b37dd0
commit 71e6d40b00

View File

@@ -104,13 +104,15 @@ public class UsageQuotaProtector implements NodeServicePolicies.OnUpdateProperti
Long sizeQuotaAfter = (Long)after.get(ContentModel.PROP_SIZE_QUOTA);
// Check for change in sizeCurrent
if ((sizeCurrentBefore != sizeCurrentAfter) && (! (authorityService.hasAdminAuthority() || authenticationService.isCurrentUserTheSystemUser())))
if ((sizeCurrentBefore != sizeCurrentAfter) && (sizeCurrentBefore != null) &&
(! (authorityService.hasAdminAuthority() || authenticationService.isCurrentUserTheSystemUser())))
{
throw new AlfrescoRuntimeException("Update failed: protected property 'sizeCurrent'");
}
// Check for change in sizeQuota
if ((sizeQuotaBefore != sizeQuotaAfter) && (! (authorityService.hasAdminAuthority() || authenticationService.isCurrentUserTheSystemUser())))
if ((sizeQuotaBefore != sizeQuotaAfter) && (sizeQuotaBefore != null) &&
(! (authorityService.hasAdminAuthority() || authenticationService.isCurrentUserTheSystemUser())))
{
throw new AlfrescoRuntimeException("Update failed: protected property 'sizeQuota'");
}