mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Taught AVM to be aware of the current user for tracking creator,
modifier, etc. AVM nodes can have ACLs. Not used for anything yet. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3657 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,6 +22,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.domain.DbAccessControlList;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
@@ -55,6 +56,11 @@ abstract class AVMNodeImpl implements AVMNode, Serializable
|
||||
* The rootness of this node.
|
||||
*/
|
||||
private boolean fIsRoot;
|
||||
|
||||
/**
|
||||
* The ACL on this node.
|
||||
*/
|
||||
private DbAccessControlList fACL;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
@@ -75,9 +81,15 @@ abstract class AVMNodeImpl implements AVMNode, Serializable
|
||||
fVersionID = -1;
|
||||
fIsRoot = false;
|
||||
long time = System.currentTimeMillis();
|
||||
fBasicAttributes = new BasicAttributesImpl("britt",
|
||||
"britt",
|
||||
"britt",
|
||||
String user =
|
||||
AVMContext.fgInstance.getAuthenticationComponent().getCurrentUserName();
|
||||
if (user == null)
|
||||
{
|
||||
user = AVMContext.fgInstance.getAuthenticationComponent().getSystemUserName();
|
||||
}
|
||||
fBasicAttributes = new BasicAttributesImpl(user,
|
||||
user,
|
||||
user,
|
||||
time,
|
||||
time,
|
||||
time);
|
||||
@@ -265,7 +277,14 @@ abstract class AVMNodeImpl implements AVMNode, Serializable
|
||||
*/
|
||||
public void updateModTime()
|
||||
{
|
||||
String user =
|
||||
AVMContext.fgInstance.getAuthenticationComponent().getCurrentUserName();
|
||||
if (user == null)
|
||||
{
|
||||
user = AVMContext.fgInstance.getAuthenticationComponent().getSystemUserName();
|
||||
}
|
||||
fBasicAttributes.setModDate(System.currentTimeMillis());
|
||||
fBasicAttributes.setLastModifier(user);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -364,4 +383,22 @@ abstract class AVMNodeImpl implements AVMNode, Serializable
|
||||
{
|
||||
AVMContext.fgInstance.fAVMNodePropertyDAO.deleteAll(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the ACL on this node.
|
||||
* @param acl The ACL to set.
|
||||
*/
|
||||
public void setAcl(DbAccessControlList acl)
|
||||
{
|
||||
fACL = acl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ACL on this node.
|
||||
* @return The ACL on this node.
|
||||
*/
|
||||
public DbAccessControlList getAcl()
|
||||
{
|
||||
return fACL;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user