Merged V2.1 to HEAD

6418: Allow getLayeringInfo on deleted nodes.
   6419: fixes for submitting of deleted directories and regenerate renditions related fixes.
   6420: Added installs to build
   6421: Build fix for sdk
   6423: WCM-710 - Submit All feature reintroducted to WCM My Modified Files views
   6424: OpenOffice connection is now tested on bootstrap.
   6425: AWC-1446 - Space Selector would show spaces you do not have access to
   6426: WCM-699 - Staging area user assets
   6427: Rollback exceptions now explicitly handled by RetryingTransactionHelper to extract the cause of the exception.
   6428: Fix for AWC-1340
   6429: Fixed transaction boundaries for full index recovery components
   6433: AR-1660 - SMB and SMB2 signature check 


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6732 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-10 21:50:49 +00:00
parent 26172af267
commit a8023d20a2
14 changed files with 111 additions and 51 deletions

View File

@@ -34,6 +34,7 @@ import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.AVMBrowseBean;
import org.alfresco.web.bean.wcm.AVMUtil;
import org.alfresco.web.bean.wcm.WebProject;
/**
@@ -48,20 +49,25 @@ public class WCMLockEvaluator implements ActionEvaluator
*/
public boolean evaluate(final Node node)
{
final FacesContext fc = FacesContext.getCurrentInstance();
final AVMLockingService avmLockService = Repository.getServiceRegistry(fc).getAVMLockingService();
final AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(fc, AVMBrowseBean.BEAN_NAME);
boolean result = false;
final String path = AVMNodeConverter.ToAVMVersionPath(node.getNodeRef()).getSecond();
final String username = Application.getCurrentUser(fc).getUserName();
WebProject webProject = avmBrowseBean.getWebProject();
if (webProject == null)
if (!AVMUtil.isMainStore(AVMUtil.getStoreName(path)))
{
// when in a workflow context, the WebProject may not be accurate on the browsebean
// so get the web project associated with the path
webProject = new WebProject(path);
final FacesContext fc = FacesContext.getCurrentInstance();
final AVMLockingService avmLockService = Repository.getServiceRegistry(fc).getAVMLockingService();
final AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(fc, AVMBrowseBean.BEAN_NAME);
final String username = Application.getCurrentUser(fc).getUserName();
WebProject webProject = avmBrowseBean.getWebProject();
if (webProject == null)
{
// when in a workflow context, the WebProject may not be accurate on the browsebean
// so get the web project associated with the path
webProject = new WebProject(path);
}
result = avmLockService.hasAccess(webProject.getNodeRef(), path, username);
}
return avmLockService.hasAccess(webProject.getNodeRef(), path, username);
return result;
}
}