Merged V3.2 to HEAD

16700: Fix for ETHREEOH-2509 - Leaving a private site breaks All Sites search for any term found in documents user created in that site.
   16703: Fix for ETHREEOH-2775 - "Show all" fails for user if permissions of folder that item was deleted from are changed to exclude them.
   16705: Fixes to Site Links dashlet component.
   16707: Fixed ETHREEOH-619 "User who is already a member of the site (or invite is pending) can be added to the invite list"

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16899 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2009-10-14 09:55:04 +00:00
parent fb35a5cf49
commit fa1e10081e
4 changed files with 47 additions and 10 deletions

View File

@@ -49,6 +49,8 @@ import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.ResultSetRow; import org.alfresco.service.cmr.search.ResultSetRow;
import org.alfresco.service.cmr.search.SearchParameters; import org.alfresco.service.cmr.search.SearchParameters;
import org.alfresco.service.cmr.search.SearchService; import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.util.CachingDateFormat; import org.alfresco.util.CachingDateFormat;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
@@ -110,6 +112,27 @@ public class TrashcanDialog extends BaseDialogBean implements IContextListener
private final static String SEARCH_TEXT_QUOTED = "PARENT:\"%s\" AND ASPECT:\"%s\" AND TEXT:\"%s\""; private final static String SEARCH_TEXT_QUOTED = "PARENT:\"%s\" AND ASPECT:\"%s\" AND TEXT:\"%s\"";
private final static String SEARCH_USERPREFIX = "@" + USER_ATTR + ":%s AND "; private final static String SEARCH_USERPREFIX = "@" + USER_ATTR + ":%s AND ";
/** The PermissionService reference */
transient protected PermissionService permissionService;
/**
* @param permissionService The PermissionService to set.
*/
public void setPermissionService(PermissionService permissionService)
{
this.permissionService = permissionService;
}
protected PermissionService getPermissionService()
{
if (permissionService == null)
{
permissionService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getPermissionService();
}
return permissionService;
}
public void setProperty(TrashcanDialogProperty property) public void setProperty(TrashcanDialogProperty property)
{ {
this.property = property; this.property = property;
@@ -278,7 +301,8 @@ public class TrashcanDialog extends BaseDialogBean implements IContextListener
public Object get(Node node) public Object get(Node node)
{ {
ChildAssociationRef childRef = (ChildAssociationRef)node.getProperties().get(ContentModel.PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC); ChildAssociationRef childRef = (ChildAssociationRef)node.getProperties().get(ContentModel.PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC);
if (getNodeService().exists(childRef.getParentRef())) if (getPermissionService().hasPermission(childRef.getParentRef(), PermissionService.READ).equals(AccessStatus.ALLOWED) &&
getNodeService().exists(childRef.getParentRef()))
{ {
return getNodeService().getPath(childRef.getParentRef()); return getNodeService().getPath(childRef.getParentRef());
} }
@@ -296,7 +320,8 @@ public class TrashcanDialog extends BaseDialogBean implements IContextListener
public Object get(Node node) public Object get(Node node)
{ {
ChildAssociationRef childRef = (ChildAssociationRef)node.getProperties().get(ContentModel.PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC); ChildAssociationRef childRef = (ChildAssociationRef)node.getProperties().get(ContentModel.PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC);
if (getNodeService().exists(childRef.getParentRef())) if (getPermissionService().hasPermission(childRef.getParentRef(), PermissionService.READ).equals(AccessStatus.ALLOWED) &&
getNodeService().exists(childRef.getParentRef()))
{ {
return Repository.getDisplayPath(getNodeService().getPath(childRef.getParentRef()), true); return Repository.getDisplayPath(getNodeService().getPath(childRef.getParentRef()), true);
} }

View File

@@ -383,7 +383,6 @@ public class AVMBrowseBean implements IContextListener
linkValidationService = (LinkValidationService)FacesContextUtils.getRequiredWebApplicationContext( linkValidationService = (LinkValidationService)FacesContextUtils.getRequiredWebApplicationContext(
FacesContext.getCurrentInstance()).getBean("LinkValidationService"); FacesContext.getCurrentInstance()).getBean("LinkValidationService");
} }
return this.linkValidationService; return this.linkValidationService;
} }
@@ -400,15 +399,14 @@ public class AVMBrowseBean implements IContextListener
*/ */
public SearchService getSearchService() public SearchService getSearchService()
{ {
//check for null for cluster environment //check for null for cluster environment
if(searchService == null) if (searchService == null)
{ {
searchService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getSearchService(); searchService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getSearchService();
} }
return searchService; return searchService;
} }
/** /**
* @param permissionService The PermissionService to set. * @param permissionService The PermissionService to set.
*/ */

View File

@@ -64,10 +64,11 @@ public class ManageReviewTaskDialog extends ManageTaskDialog
protected String webapp; protected String webapp;
protected NodeRef webProjectRef; protected NodeRef webProjectRef;
protected AVMBrowseBean avmBrowseBean; protected AVMBrowseBean avmBrowseBean;
protected PermissionService permissionService; transient protected PermissionService permissionService;
private static final Log logger = LogFactory.getLog(ManageReviewTaskDialog.class); private static final Log logger = LogFactory.getLog(ManageReviewTaskDialog.class);
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Implementation // Implementation
@@ -200,13 +201,22 @@ public class ManageReviewTaskDialog extends ManageTaskDialog
} }
/** /**
* @param permissionService PermissionService instance * @param permissionService The PermissionService to set.
*/ */
public void setPermissionService(PermissionService permissionService) public void setPermissionService(PermissionService permissionService)
{ {
this.permissionService = permissionService; this.permissionService = permissionService;
} }
protected PermissionService getPermissionService()
{
if (permissionService == null)
{
permissionService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getPermissionService();
}
return permissionService;
}
/** /**
* @return Determines if there are any test servers configured for the * @return Determines if there are any test servers configured for the
* web project this task belongs to * web project this task belongs to
@@ -226,7 +236,7 @@ public class ManageReviewTaskDialog extends ManageTaskDialog
{ {
result = Boolean.FALSE; result = Boolean.FALSE;
if (this.webProjectRef != null && permissionService.hasPermission(webProjectRef, PermissionService.READ_PROPERTIES).equals(AccessStatus.ALLOWED)) if (this.webProjectRef != null && getPermissionService().hasPermission(webProjectRef, PermissionService.READ_PROPERTIES).equals(AccessStatus.ALLOWED))
{ {
List<NodeRef> testServers = DeploymentUtil.findTestServers(this.webProjectRef, false); List<NodeRef> testServers = DeploymentUtil.findTestServers(this.webProjectRef, false);
if (testServers != null) if (testServers != null)

View File

@@ -2444,6 +2444,10 @@
<property-name>searchService</property-name> <property-name>searchService</property-name>
<value>#{SearchService}</value> <value>#{SearchService}</value>
</managed-property> </managed-property>
<managed-property>
<property-name>permissionService</property-name>
<value>#{PermissionService}</value>
</managed-property>
<managed-property> <managed-property>
<property-name>dictionaryService</property-name> <property-name>dictionaryService</property-name>
<value>#{DictionaryService}</value> <value>#{DictionaryService}</value>