Skip to content

Commit

Permalink
Merge pull request #856 from nextcloud/backport/850/stable-2.10
Browse files Browse the repository at this point in the history
[stable-2.10] Retrieve permission when doing a gallery search
  • Loading branch information
AlvaroBrey authored Apr 7, 2022
2 parents 424fdb4 + 4223587 commit ee0f4ee
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
*/
package com.owncloud.android.lib.resources.files;

import static com.owncloud.android.lib.common.network.WebdavEntry.NAMESPACE_OC;

import com.owncloud.android.lib.resources.status.NextcloudVersion;
import com.owncloud.android.lib.resources.status.OCCapability;

Expand All @@ -47,6 +45,8 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import static com.owncloud.android.lib.common.network.WebdavEntry.NAMESPACE_OC;

public class NcSearchMethod extends org.apache.jackrabbit.webdav.client.methods.SearchMethod {
private static final String HEADER_CONTENT_TYPE_VALUE = "text/xml";
private static final String DAV_NAMESPACE = "DAV:";
Expand Down Expand Up @@ -126,7 +126,6 @@ private Document createQuery(String searchQuery) {
selectPropsElement.appendChild(creationDate);
selectPropsElement.appendChild(quotaUsedElement);
selectPropsElement.appendChild(quotaAvailableElement);
selectPropsElement.appendChild(permissionsElement);
selectPropsElement.appendChild(sizeElement);
}
if (searchType == SearchRemoteOperation.SearchType.GALLERY_SEARCH) {
Expand All @@ -139,6 +138,7 @@ private Document createQuery(String searchQuery) {
selectPropsElement.appendChild(etagElement);
selectPropsElement.appendChild(remoteIdElement);
selectPropsElement.appendChild(favoriteElement);
selectPropsElement.appendChild(permissionsElement);

Element fromElement = query.createElementNS(DAV_NAMESPACE, "d:from");
Element scopeElement = query.createElementNS(DAV_NAMESPACE, "d:scope");
Expand Down

0 comments on commit ee0f4ee

Please sign in to comment.