server icon indicating copy to clipboard operation
server copied to clipboard

Exclude groups from sharing not working with users belonging to several groups

Open scanom opened this issue 7 years ago • 3 comments

Steps to reproduce

  1. Add a group (internal or from LDAP) to "Exclude groups from sharing"
  2. Users belonging to the group, it they belong to another unrestricted group, can create shares.

Expected behaviour

The users belonging to that groups should not be able to create any share.

Actual behaviour

The users can create shares

Server configuration

Operating system: Centos 7.7

Web server: Apache 2.4.41

Database: MariaDB 10.3.18

PHP version: 7.3.9

Nextcloud version: 15.0.11

Updated from an older Nextcloud/ownCloud or fresh install: Updated from 15.0.1

Where did you install Nextcloud from: Official channels

Signing status:

Signing status
No results have been found.

List of activated apps:

App list
Enabled:
  - accessibility: 1.1.0
  - activity: 2.8.2
  - admin_audit: 1.5.0
  - apporder: 0.6.0
  - calendar: 1.6.6
  - cloud_federation_api: 0.1.0
  - comments: 1.5.0
  - dav: 1.8.2
  - deck: 0.6.6
  - federatedfilesharing: 1.5.0
  - files: 1.10.0
  - files_external: 1.6.0
  - files_pdfviewer: 1.4.0
  - files_sharing: 1.7.0
  - files_videoplayer: 1.4.0
  - gallery: 18.2.0
  - impersonate: 1.2.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.3.0
  - mail: 0.11.1
  - notifications: 2.3.0
  - oauth2: 1.3.0
  - onlyoffice: 3.0.0
  - password_policy: 1.5.0
  - provisioning_api: 1.5.0
  - ransomware_protection: 1.3.0
  - serverinfo: 1.5.0
  - socialsharing_email: 1.0.5
  - spreed: 5.0.4
  - support: 1.0.0
  - systemtags: 1.5.0
  - tasks: 0.11.3
  - theming: 1.6.0
  - twofactor_backupcodes: 1.4.1
  - twofactor_totp: 2.1.2
  - updatenotification: 1.5.0
  - user_ldap: 1.5.0
  - workflowengine: 1.5.0
Disabled:
  - encryption
  - federation
  - files_rightclick
  - files_texteditor
  - files_trashbin
  - files_versions
  - firstrunwizard
  - nextcloud_announcements
  - sharebymail
  - survey_client

Nextcloud configuration:

Config report
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "aaa.bbb.cc",
            "aaa-ddd.cc"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "15.0.11.1",
        "overwrite.cli.url": "https:\/\/aaa.bbb.cc",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "overwriteprotocol": "https",
        "blacklisted_files": [
            ".htaccess",
            "Thumbs.db",
            "thumbs.db"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "maintenance": false,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "twofactor_enforced": "false",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "updater.release.channel": "production",
        "theme": "",
        "loglevel": 2,
        "log_rotate_size": 104857600,
        "lost_password_link": "disabled"
    }
}

Are you using external storage, if yes which one: SMB

Are you using encryption: NO

Are you using an external user-backend, if yes which one: LDAP

LDAP configuration (delete this part if not used)

LDAP config
+-----------+--------------------------------------+----------------------------------------------+
| appid     | configkey                            | configvalue                                  |
+-----------+--------------------------------------+----------------------------------------------+
| user_ldap | background_sync_interval             | 43200                                        |
| user_ldap | background_sync_offset               | 0                                            |
| user_ldap | background_sync_prefix               | s01                                          |
| user_ldap | cleanUpJobOffset                     | 0                                            |
| user_ldap | enabled                              | yes                                          |
| user_ldap | installed_version                    | 1.5.0                                        |
| user_ldap | s01_lastChange                       | 1570173314                                   |
| user_ldap | s01has_memberof_filter_support       | 1                                            |
| user_ldap | s01home_folder_naming_rule           |                                              |
| user_ldap | s01last_jpegPhoto_lookup             | 0                                            |
| user_ldap | s01ldap_agent_password               | HIDDEN                                       |
| user_ldap | s01ldap_attributes_for_group_search  |                                              |
| user_ldap | s01ldap_attributes_for_user_search   |                                              |
| user_ldap | s01ldap_backup_host                  | HIDDEN                                       |
| user_ldap | s01ldap_backup_port                  | 3269                                         |
| user_ldap | s01ldap_base                         | HIDDEN                                       |
| user_ldap | s01ldap_base_groups                  | HIDDEN                                       |
| user_ldap | s01ldap_base_users                   | HIDDEN                                       |
| user_ldap | s01ldap_cache_ttl                    | 600                                          |
| user_ldap | s01ldap_configuration_active         | 1                                            |
| user_ldap | s01ldap_default_ppolicy_dn           |                                              |
| user_ldap | s01ldap_display_name                 | displayname                                  |
| user_ldap | s01ldap_dn                           | HIDDEN                                       |
| user_ldap | s01ldap_dynamic_group_member_url     |                                              |
| user_ldap | s01ldap_email_attr                   | mail                                         |
| user_ldap | s01ldap_experienced_admin            | 0                                            |
| user_ldap | s01ldap_expert_username_attr         | sAMAccountName                               |
| user_ldap | s01ldap_expert_uuid_group_attr       |                                              |
| user_ldap | s01ldap_expert_uuid_user_attr        |                                              |
| user_ldap | s01ldap_gid_number                   | gidNumber                                    |
| user_ldap | s01ldap_group_display_name           | cn                                           |
| user_ldap | s01ldap_group_filter                 | xxx                                          |
| user_ldap | s01ldap_group_filter_mode            | 0                                            |
| user_ldap | s01ldap_group_member_assoc_attribute | member                                       |
| user_ldap | s01ldap_groupfilter_groups           |                                              |
| user_ldap | s01ldap_groupfilter_objectclass      | xxx                                          |
| user_ldap | s01ldap_host                         | ldaps://HIDDEN                               |
| user_ldap | s01ldap_login_filter                 | HIDDEN                                       |
| user_ldap | s01ldap_login_filter_mode            | 0                                            |
| user_ldap | s01ldap_loginfilter_attributes       |                                              |
| user_ldap | s01ldap_loginfilter_email            | 0                                            |
| user_ldap | s01ldap_loginfilter_username         | 1                                            |
| user_ldap | s01ldap_nested_groups                | 0                                            |
| user_ldap | s01ldap_override_main_server         |                                              |
| user_ldap | s01ldap_paging_size                  | 500                                          |
| user_ldap | s01ldap_port                         | 3269                                         |
| user_ldap | s01ldap_quota_attr                   |                                              |
| user_ldap | s01ldap_quota_def                    |                                              |
| user_ldap | s01ldap_tls                          | 0                                            |
| user_ldap | s01ldap_turn_off_cert_check          | 0                                            |
| user_ldap | s01ldap_turn_on_pwd_change           | 0                                            |
| user_ldap | s01ldap_user_avatar_rule             | default                                      |
| user_ldap | s01ldap_user_display_name_2          |                                              |
| user_ldap | s01ldap_user_filter_mode             | 0                                            |
| user_ldap | s01ldap_userfilter_groups            | HIDDEN                                       |
| user_ldap | s01ldap_userfilter_objectclass       | person                                       |
| user_ldap | s01ldap_userlist_filter              | HIDDEN                                       |
| user_ldap | s01use_memberof_to_detect_membership | 1                                            |
| user_ldap | types                                | authentication                               |
| user_ldap | updateAttributesInterval             | 86400                                        |
+-----------+--------------------------------------+----------------------------------------------+

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

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

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

scanom avatar Oct 04 '19 07:10 scanom

Exclude groups from sharing works when the user only belongs to excluded groups. If the user belongs to at least one group with sharing permission then sharing is allowed. Not very intuitive imho, but works.

scanom avatar Oct 07 '19 12:10 scanom

Why did you close this? I think this should really be changed. I don't want to remove users from all other groups to prevent them from creating shares.

Another option, probably better in my situation, would be to have an include list instead of exclude groups list. I would be able to allow only one group to share files and simply add users that should be able to do so in that group. This would fit perfectly in my setup.

But as long as an include option is not implemented, it would really help if this bug would get fixed.

Bleuzen avatar Feb 06 '20 18:02 Bleuzen

It is closed because it is no bug: The permission model adds a permission to share if you are member of a group with sharing rights. Of course, it would also be possible to have it the other way, but you can't have both and the current model makes sense. One might rephrase the "Exclude from sharing" to avoid people thinking it will prevent you from sharing if you belong to one of these groups.

Nils160988 avatar Feb 06 '20 21:02 Nils160988