Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect public link password enforcement capability #8587

Closed
micbar opened this issue Mar 10, 2023 · 7 comments · Fixed by #8623
Closed

Respect public link password enforcement capability #8587

micbar opened this issue Mar 10, 2023 · 7 comments · Fixed by #8623
Labels
Category:Enhancement Add new functionality

Comments

@micbar
Copy link
Contributor

micbar commented Mar 10, 2023

Description

There is a capability which is used in oc10 and ocis to indicate that public links need a password to be sucessfully created/changed.

ownCloud Web seems to currently not respect that capability.

ocis

{
    "api_enabled": true,
    "resharing": true,
    "group_sharing": true,
    "sharing_roles": true,
    "deny_access": false,
    "auto_accept_share": true,
    "share_with_group_members_only": true,
    "share_with_membership_groups_only": true,
    "search_min_length": 3,
    "default_permissions": 22,
    "user_enumeration": {
        "enabled": true,
        "group_members_only": true
    },
    "federation": {
        "outgoing": false,
        "incoming": false
    },
    "public": {
        "enabled": true,
        "send_mail": true,
        "social_share": true,
        "upload": true,
        "multiple": true,
        "supports_upload_only": true,
        "password": {
            "enforced_for": {
                "read_only": false,
                "read_write": true,
                "upload_only": true
            },
            "enforced": false
        },
        "expire_date": {
            "enabled": false
        },
        "can_edit": true,
        "alias": true
    },
    "user": {
        "send_mail": true,
        "profile_picture": false,
        "settings": [
            {
                "enabled": true,
                "version": "1.0.0"
            }
        ],
        "expire_date": {
            "enabled": true
        }
    }
}

The capability tells the clients, on which public link type the password needs to be enforced:

"password": {
            "enforced_for": {
                "read_only": false,
                "read_write": true,
                "upload_only": true
            },
            "enforced": false
        },
@micbar micbar added the Category:Enhancement Add new functionality label Mar 10, 2023
@micbar
Copy link
Contributor Author

micbar commented Mar 10, 2023

@tbsbdr @kulmann FYI

@JammingBen
Copy link
Contributor

JammingBen commented Mar 10, 2023

Web should already respect the capability when creating public links via the share panel or the quick action. But the check is missing when creating links via the context action "Copy quicklink".

Also, there are some conflicts with the internal role, because that one does not support password protection. -> okay that should be fine actually, internal links just can't be created if passwords are enforced (for now at least).

@micbar
Copy link
Contributor Author

micbar commented Mar 15, 2023

@JammingBen

ownCloud Web 7.0.0-rc.20

  1. set OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD: "true"
  2. try to create link with "Editor" permission
  3. "updating the share failed"

Response

<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>error</status><statuscode>996</statuscode><message>Error sending update request to public link provider: the public share needs to have a password</message></meta></ocs>

@kulmann
Copy link
Member

kulmann commented Mar 15, 2023

Turns out, there are bugs backend side and frontend side:

  • backend: the password enforced for capability read_write_delete, which represents the Editor role, is missing
  • frontend: the isPasswordEnforcedFor check returns early with the first capability that was true. It doesn't check that it's in the context that is represented by the capability.

@JammingBen
Copy link
Contributor

Creating links via the context menu still ignores the read_only capability 👀

@JammingBen
Copy link
Contributor

This works as expected by now, hence closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Enhancement Add new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants