mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixes for AWC-1160 and AWC-1161
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5389 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -49,7 +49,7 @@ public class CheckoutDocEvaluator implements ActionEvaluator
|
|||||||
FacesContext.getCurrentInstance()).getDictionaryService();
|
FacesContext.getCurrentInstance()).getDictionaryService();
|
||||||
|
|
||||||
return dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT) &&
|
return dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT) &&
|
||||||
((node.hasPermission(PermissionService.CHECK_OUT) &&
|
((node.hasPermission(PermissionService.CHECK_OUT) && node.hasPermission(PermissionService.CREATE_CHILDREN) &&
|
||||||
(node.isLocked() == false &&
|
(node.isLocked() == false &&
|
||||||
node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false)));
|
node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false)));
|
||||||
}
|
}
|
||||||
|
@@ -31,8 +31,6 @@ import javax.faces.context.ResponseWriter;
|
|||||||
import javax.faces.el.ValueBinding;
|
import javax.faces.el.ValueBinding;
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.service.cmr.lock.LockService;
|
|
||||||
import org.alfresco.service.cmr.lock.LockStatus;
|
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
@@ -117,9 +115,12 @@ public class UILockIcon extends SelfRenderingComponent
|
|||||||
ref = (NodeRef)val;
|
ref = (NodeRef)val;
|
||||||
if (nodeService.exists(ref) && nodeService.hasAspect(ref, ContentModel.ASPECT_LOCKABLE) == true)
|
if (nodeService.exists(ref) && nodeService.hasAspect(ref, ContentModel.ASPECT_LOCKABLE) == true)
|
||||||
{
|
{
|
||||||
LockStatus lockStatus = getLockService(context).getLockStatus(ref);
|
String lockerUser = (String)nodeService.getProperty(ref, ContentModel.PROP_LOCK_OWNER);
|
||||||
locked = (lockStatus == LockStatus.LOCKED || lockStatus == LockStatus.LOCK_OWNER);
|
if (lockerUser != null)
|
||||||
lockedOwner = (lockStatus == LockStatus.LOCK_OWNER);
|
{
|
||||||
|
locked = true;
|
||||||
|
lockedOwner = (lockerUser.equals(Application.getCurrentUser(context).getUserName()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,24 +196,6 @@ public class UILockIcon extends SelfRenderingComponent
|
|||||||
return service;
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Use Spring JSF integration to return the Lock Service bean instance
|
|
||||||
*
|
|
||||||
* @param context FacesContext
|
|
||||||
*
|
|
||||||
* @return Lock Service bean instance or throws exception if not found
|
|
||||||
*/
|
|
||||||
private static LockService getLockService(FacesContext context)
|
|
||||||
{
|
|
||||||
LockService service = Repository.getServiceRegistry(context).getLockService();
|
|
||||||
if (service == null)
|
|
||||||
{
|
|
||||||
throw new IllegalStateException("Unable to obtain LockService bean reference.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return service;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// Strongly typed component property accessors
|
// Strongly typed component property accessors
|
||||||
|
Reference in New Issue
Block a user