Merged 1.4 to HEAD

svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4392 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V1.4@4399 .
   svn resolved root\projects\repository\source\java\org\alfresco\repo\jscript\Node.java


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4660 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-12-19 16:01:52 +00:00
parent b596814861
commit c4e8e02cf8
3 changed files with 13 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ import org.alfresco.service.cmr.lock.LockService;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.TemplateNode;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.version.Version;
import org.alfresco.service.cmr.version.VersionHistory;
import org.alfresco.service.cmr.version.VersionService;
@@ -638,7 +639,8 @@ public class DocumentDetailsBean extends BaseDetailsBean
}
/**
* @return the working copy document Node for this document if found or null if not
* @return the working copy document Node for this document if found and the
* current has permission or null if not
*/
public Node getWorkingCopyDocument()
{
@@ -650,6 +652,13 @@ public class DocumentDetailsBean extends BaseDetailsBean
if (workingCopyRef != null)
{
workingCopyNode = new Node(workingCopyRef);
// if the current user does not have read permission on
// working copy return null
if (workingCopyNode.hasPermission(PermissionService.READ) == false)
{
workingCopyNode = null;
}
}
}