nextcloud / nextcloud/server

Only show share parent folder if you have both shared with you

Open
#4,785 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement feature: sharing
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Given a structure like this:
folder1/folder2
If I share folder1 with group A and folder2 with group B, a user who is in both groups will see the two shares, one is folder1 containing folder2 and one is folder2 itself. I you sync shared folders to devices (which I do), it will also get synced twice.

Steps to reproduce
  1. Create a nested folder structure
  2. Create a user in two groups
  3. Share folder1 with Group A en folder 2 with group B
  4. Check in web and sync shared folders to device
Expected behaviour

The share should only appear once for each user. I'm also in favor of maintaining directory structure where a user that is not in group A (so has no rights on folder1), actually still has the directory hierarchy intacted, so that with the name of the shared folder set in config (shared for me), the hierarchy Shared/folder1/folder2 is always the same

Actual behaviour

Hierarchy is discarded if you are not in Group A and data is duplicated if you are in groups A and B

Server configuration

Operating system:
Ubuntu 16.04

Web server:
Nginx

Database:
Postgres

PHP version:
7.0.2

Nextcloud version: (see Nextcloud admin page)
11.0.3

Updated from an older Nextcloud/ownCloud or fresh install:
Updaded from Owncloud < 7

Where did you install Nextcloud from:
tar.bz2

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

No errors have been found.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Enabled:

  • activity: 2.4.1
  • admin_audit: 1.1.0
  • comments: 1.1.0
  • dav: 1.1.1
  • federatedfilesharing: 1.1.1
  • federation: 1.1.1
  • files: 1.6.1
  • files_accesscontrol: 1.1.2
  • files_pdfviewer: 1.0.1
  • files_sharing: 1.1.1
  • files_texteditor: 2.2
  • files_trashbin: 1.1.0
  • files_versions: 1.4.0
  • files_videoplayer: 1.0.0
  • firstrunwizard: 2.0
  • gallery: 16.0.0
  • keeweb: 0.3.1
  • logreader: 2.0.0
  • lookup_server_connector: 1.0.0
  • nextant: 1.0.8
  • nextcloud_announcements: 1.0
  • notes: 2.2.0
  • notifications: 1.0.1
  • password_policy: 1.1.0
  • provisioning_api: 1.1.0
  • serverinfo: 1.1.1
  • sharebymail: 1.0.1
  • spreed: 1.2.0
  • survey_client: 0.1.5
  • systemtags: 1.1.3
  • templateeditor: 0.2
  • theming: 1.1.1
  • twofactor_backupcodes: 1.0.0
  • updatenotification: 1.1.1
  • user_ldap: 1.1.2
  • workflowengine: 1.1.1
    Disabled:
  • bookmarks
  • documents
  • encryption
  • external
  • files_automatedtagging
  • files_external
  • files_retention
  • user_external
  • user_saml

Nextcloud configuration:

Config report
"system": {
    "instanceid": "51349c4450b43",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "datadirectory": "\/nas\/owncloud\/data",
    "dbtype": "pgsql",
    "version": "11.0.3.2",
    "dbname": "owncloud",
    "dbhost": "***",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "ldapIgnoreNamingRules": false,
    "loglevel": "1",
    "maintenance": false,
    "theme": "",
    "forcessl": false,
    "trusted_domains": [
        "oc.taurix.net",
        "oc.internal.taurix.net"
    ],
    "mail_smtpmode": "php",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "share_folder": "\/Shared",
    "redis": {
        "host": "***",
        "port": 6379,
        "timeout": 0
    },
    "memcache.local": "\\OC\\Memcache\\Redis",
    "filelocking.enabled": "true",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "trashbin_retention_obligation": "auto",
    "singleuser": false,
    "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
    "trusted_proxies": [
        "***"
    ],
    "forwarded_for_headers": [
        "HTTP_X_FORWARDED_FOR"
    ]
}
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...
no

Are you using encryption: yes/no
no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
LDAP

LDAP configuration (delete this part if not used)
LDAP config +-------------------------------+----------------------------------------------------------------+ | Configuration | | +-------------------------------+----------------------------------------------------------------+ | hasMemberOfFilterSupport | 1 | | hasPagedResultSupport | | | homeFolderNamingRule | opt:username | | lastJpegPhotoLookup | 0 | | ldapAgentName | uid=diradmin,cn=users,cn=accounts,dc=internal,dc=taurix,dc=net | | ldapAgentPassword | *** | | ldapAttributesForGroupSearch | | | ldapAttributesForUserSearch | | | ldapBackupHost | ipa02.internal.taurix.net | | ldapBackupPort | 389 | | ldapBase | dc=internal,dc=taurix,dc=net | | ldapBaseGroups | dc=internal,dc=taurix,dc=net | | ldapBaseUsers | cn=users,cn=accounts,dc=internal,dc=taurix,dc=net | | ldapCacheTTL | 600 | | ldapConfigurationActive | 1 | | ldapDynamicGroupMemberURL | | | ldapEmailAttribute | mail | | ldapExperiencedAdmin | 0 | | ldapExpertUUIDGroupAttr | | | ldapExpertUUIDUserAttr | uid | | ldapExpertUsernameAttr | uid | | ldapGroupDisplayName | cn | | ldapGroupFilter | objectClass=posixGroup | | ldapGroupFilterGroups | | | ldapGroupFilterMode | 1 | | ldapGroupFilterObjectclass | | | ldapGroupMemberAssocAttr | memberUid | | ldapHost | ipa01.internal.taurix.net | | ldapIgnoreNamingRules | | | ldapLoginFilter | uid=%uid | | ldapLoginFilterAttributes | | | ldapLoginFilterEmail | 0 | | ldapLoginFilterMode | 1 | | ldapLoginFilterUsername | 1 | | ldapNestedGroups | 0 | | ldapOverrideMainServer | | | ldapPagingSize | 500 | | ldapPort | 389 | | ldapQuotaAttribute | | | ldapQuotaDefault | | | ldapTLS | 0 | | ldapUserDisplayName | uid | | ldapUserDisplayName2 | | | ldapUserFilter | (|(objectclass=zarafa-user)) | | ldapUserFilterGroups | | | ldapUserFilterMode | 0 | | ldapUserFilterObjectclass | zarafa-user | | ldapUuidGroupAttribute | auto | | ldapUuidUserAttribute | auto | | turnOffCertCheck | 0 | | turnOnPasswordChange | 0 | | useMemberOfToDetectMembership | 1 | +-------------------------------+----------------------------------------------------------------+ +-------------------------------+----------------+ | Configuration | s01 | +-------------------------------+----------------+ | hasMemberOfFilterSupport | 0 | | hasPagedResultSupport | | | homeFolderNamingRule | | | lastJpegPhotoLookup | 0 | | ldapAgentName | | | ldapAgentPassword | *** | | ldapAttributesForGroupSearch | | | ldapAttributesForUserSearch | | | ldapBackupHost | | | ldapBackupPort | | | ldapBase | | | ldapBaseGroups | | | ldapBaseUsers | | | ldapCacheTTL | 600 | | ldapConfigurationActive | 0 | | ldapDynamicGroupMemberURL | | | ldapEmailAttribute | | | ldapExperiencedAdmin | 0 | | ldapExpertUUIDGroupAttr | | | ldapExpertUUIDUserAttr | | | ldapExpertUsernameAttr | | | ldapGroupDisplayName | cn | | ldapGroupFilter | | | ldapGroupFilterGroups | | | ldapGroupFilterMode | 1 | | ldapGroupFilterObjectclass | | | ldapGroupMemberAssocAttr | uniqueMember | | ldapHost | 192.168.122.18 | | ldapIgnoreNamingRules | | | ldapLoginFilter | | | ldapLoginFilterAttributes | | | ldapLoginFilterEmail | 0 | | ldapLoginFilterMode | 1 | | ldapLoginFilterUsername | 1 | | ldapNestedGroups | 0 | | ldapOverrideMainServer | | | ldapPagingSize | 500 | | ldapPort | | | ldapQuotaAttribute | | | ldapQuotaDefault | | | ldapTLS | 1 | | ldapUserDisplayName | displayname | | ldapUserDisplayName2 | | | ldapUserFilter | | | ldapUserFilterGroups | | | ldapUserFilterMode | 1 | | ldapUserFilterObjectclass | | | ldapUuidGroupAttribute | auto | | ldapUuidUserAttribute | auto | | turnOffCertCheck | 0 | | turnOnPasswordChange | 0 | | useMemberOfToDetectMembership | 1 | +-------------------------------+----------------+ ``` With access to your command line run e.g.: sudo -u www-data php occ ldap:show-config from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM oc_appconfig WHERE appid = 'user_ldap';

Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

</details>

### Client configuration
**Browser:**
Firefox/Chrome/Safari

**Operating system:**
Linux/ OS X

### Logs
#### Web server error log
<details>
<summary>Web server error log</summary>
No errors in log

Insert your webserver log here

</details>

#### Nextcloud log (data/nextcloud.log)
<details>
<summary>Nextcloud log</summary>

Insert your Nextcloud log here

</details>

#### Browser log
<details>
<summary>Browser log</summary>

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

</details>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the nested-folder case with overlapping group shares, checking both the web view and device synchronization described in the steps. Done means a user sees each shared folder only once, while the expected directory hierarchy remains intact when access to a parent folder is missing.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authorization, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.