mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Dropped nullPermissionCache
- A node's AccessControlList is attached to the node directly now git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2849 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,47 +25,6 @@
|
|||||||
|
|
||||||
<bean name="internalEHCacheManager" class="org.alfresco.repo.cache.InternalEhCacheManagerFactoryBean" />
|
<bean name="internalEHCacheManager" class="org.alfresco.repo.cache.InternalEhCacheManagerFactoryBean" />
|
||||||
|
|
||||||
<!-- ================ -->
|
|
||||||
<!-- Null permissions -->
|
|
||||||
<!-- ================ -->
|
|
||||||
|
|
||||||
<!-- The cross-transaction shared cache for Null Node Permissions -->
|
|
||||||
|
|
||||||
<bean name="nullPermissionSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
|
|
||||||
<property name="cache">
|
|
||||||
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
|
|
||||||
<property name="cacheManager">
|
|
||||||
<ref bean="internalEHCacheManager" />
|
|
||||||
</property>
|
|
||||||
<property name="cacheName">
|
|
||||||
<value>nullPermissionCache</value>
|
|
||||||
</property>
|
|
||||||
<property name="maxElementsInMemory">
|
|
||||||
<value>10000</value> <!-- approx 8MB memory required -->
|
|
||||||
</property>
|
|
||||||
<property name="overflowToDisk">
|
|
||||||
<value>false</value>
|
|
||||||
</property>
|
|
||||||
</bean>
|
|
||||||
</property>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<!-- The transactional cache for Null Node Permissions -->
|
|
||||||
|
|
||||||
<bean name="nullPermissionCache" class="org.alfresco.repo.cache.TransactionalCache">
|
|
||||||
<property name="sharedCache">
|
|
||||||
<ref bean="nullPermissionSharedCache" />
|
|
||||||
</property>
|
|
||||||
<property name="cacheManager" >
|
|
||||||
<ref bean="transactionalEHCacheManager" />
|
|
||||||
</property>
|
|
||||||
<property name="name">
|
|
||||||
<value>nullPermissionTransactionalCache</value>
|
|
||||||
</property>
|
|
||||||
<property name="maxCacheSize">
|
|
||||||
<value>5000</value>
|
|
||||||
</property>
|
|
||||||
</bean>
|
|
||||||
|
|
||||||
<!-- ===================================== -->
|
<!-- ===================================== -->
|
||||||
<!-- Authority container look up for users -->
|
<!-- Authority container look up for users -->
|
||||||
|
@@ -95,9 +95,6 @@
|
|||||||
<property name="sessionFactory">
|
<property name="sessionFactory">
|
||||||
<ref bean="sessionFactory" />
|
<ref bean="sessionFactory" />
|
||||||
</property>
|
</property>
|
||||||
<property name="nullPermissionCache">
|
|
||||||
<ref bean="nullPermissionCache" />
|
|
||||||
</property>
|
|
||||||
<property name="nodeDaoService">
|
<property name="nodeDaoService">
|
||||||
<ref bean="nodeDaoService" />
|
<ref bean="nodeDaoService" />
|
||||||
</property>
|
</property>
|
||||||
|
@@ -21,7 +21,6 @@ import java.util.Collections;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.alfresco.repo.cache.SimpleCache;
|
|
||||||
import org.alfresco.repo.domain.DbAccessControlEntry;
|
import org.alfresco.repo.domain.DbAccessControlEntry;
|
||||||
import org.alfresco.repo.domain.DbAccessControlList;
|
import org.alfresco.repo.domain.DbAccessControlList;
|
||||||
import org.alfresco.repo.domain.DbAuthority;
|
import org.alfresco.repo.domain.DbAuthority;
|
||||||
@@ -62,7 +61,6 @@ public class PermissionsDaoComponentImpl extends HibernateDaoSupport implements
|
|||||||
public static final String QUERY_GET_AC_ENTRIES_FOR_PERMISSION = "permission.GetAccessControlEntriesForPermission";
|
public static final String QUERY_GET_AC_ENTRIES_FOR_PERMISSION = "permission.GetAccessControlEntriesForPermission";
|
||||||
|
|
||||||
private NodeDaoService nodeDaoService;
|
private NodeDaoService nodeDaoService;
|
||||||
private SimpleCache<NodeRef, SimpleNodePermissionEntry> nullPermissionCache;
|
|
||||||
|
|
||||||
public PermissionsDaoComponentImpl()
|
public PermissionsDaoComponentImpl()
|
||||||
{
|
{
|
||||||
@@ -74,11 +72,6 @@ public class PermissionsDaoComponentImpl extends HibernateDaoSupport implements
|
|||||||
this.nodeDaoService = nodeDaoService;
|
this.nodeDaoService = nodeDaoService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNullPermissionCache(SimpleCache<NodeRef, SimpleNodePermissionEntry> nullPermissionCache)
|
|
||||||
{
|
|
||||||
this.nullPermissionCache = nullPermissionCache;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NodePermissionEntry getPermissions(NodeRef nodeRef)
|
public NodePermissionEntry getPermissions(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
// Create the object if it is not found.
|
// Create the object if it is not found.
|
||||||
@@ -86,11 +79,7 @@ public class PermissionsDaoComponentImpl extends HibernateDaoSupport implements
|
|||||||
// If the object does not exist it will repeatedly query to check its
|
// If the object does not exist it will repeatedly query to check its
|
||||||
// non existence.
|
// non existence.
|
||||||
|
|
||||||
NodePermissionEntry npe = nullPermissionCache.get(nodeRef);
|
NodePermissionEntry npe = null;
|
||||||
if (npe != null)
|
|
||||||
{
|
|
||||||
return npe;
|
|
||||||
}
|
|
||||||
DbAccessControlList acl = null;
|
DbAccessControlList acl = null;
|
||||||
Node node = getNode(nodeRef, false);
|
Node node = getNode(nodeRef, false);
|
||||||
if (node != null)
|
if (node != null)
|
||||||
@@ -106,7 +95,6 @@ public class PermissionsDaoComponentImpl extends HibernateDaoSupport implements
|
|||||||
true,
|
true,
|
||||||
Collections.<SimplePermissionEntry> emptySet());
|
Collections.<SimplePermissionEntry> emptySet());
|
||||||
npe = snpe;
|
npe = snpe;
|
||||||
nullPermissionCache.put(nodeRef, snpe);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -159,7 +147,6 @@ public class PermissionsDaoComponentImpl extends HibernateDaoSupport implements
|
|||||||
node.setAccessControlList(acl);
|
node.setAccessControlList(acl);
|
||||||
|
|
||||||
NodeRef nodeRef = node.getNodeRef();
|
NodeRef nodeRef = node.getNodeRef();
|
||||||
nullPermissionCache.remove(nodeRef);
|
|
||||||
|
|
||||||
// done
|
// done
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
@@ -290,8 +277,6 @@ public class PermissionsDaoComponentImpl extends HibernateDaoSupport implements
|
|||||||
DbAuthority dbAuthority = getAuthority(authority, true);
|
DbAuthority dbAuthority = getAuthority(authority, true);
|
||||||
// set persistent objects
|
// set persistent objects
|
||||||
entry = dbAccessControlList.newEntry(dbPermission, dbAuthority, allow);
|
entry = dbAccessControlList.newEntry(dbPermission, dbAuthority, allow);
|
||||||
// drop the entry from the null cache
|
|
||||||
nullPermissionCache.remove(nodeRef);
|
|
||||||
// done
|
// done
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
||||||
|
@@ -49,7 +49,6 @@ import org.alfresco.service.cmr.security.PermissionService;
|
|||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.transaction.TransactionService;
|
import org.alfresco.service.transaction.TransactionService;
|
||||||
import org.alfresco.util.ApplicationContextHelper;
|
import org.alfresco.util.ApplicationContextHelper;
|
||||||
import org.alfresco.util.TempFileProvider;
|
|
||||||
import org.alfresco.util.TestWithUserUtils;
|
import org.alfresco.util.TestWithUserUtils;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user