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

Cannot delete file from viewer if opened via "share by link" #926

Open
kalsan opened this issue May 31, 2021 · 4 comments
Open

Cannot delete file from viewer if opened via "share by link" #926

kalsan opened this issue May 31, 2021 · 4 comments
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working

Comments

@kalsan
Copy link

kalsan commented May 31, 2021

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Create a folder and dump photos into it
  2. Share the folder via link, allow "editing and upload"
  3. Open the link, delete a picture directly in the list, it works
  4. Click on another picture to open it, select "..." on the top right and click delete -> you are now asked for credentials, which is unexpected, because it worked without credentials in 3.

Expected behaviour

In step 4, the picture should be deleted.

Actual behaviour

Credentials are required in step 4. Cancelling the simple auth form results in a 401.

Server configuration

**Operating system:**Latest docker image

Web server: Latest docker image

Database: Mariadb

PHP version: Latest docker image

Nextcloud version: 21.0.2

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

Where did you install Nextcloud from: Latest docker image

Signing status:

Signing status
No errors have been found.

List of activated apps:

Enabled:
  - accessibility: 1.7.0
  - activity: 2.14.3
  - cloud_federation_api: 1.4.0
  - comments: 1.11.0
  - contacts: 3.5.1
  - contactsinteraction: 1.2.0
  - dav: 1.17.1
  - federatedfilesharing: 1.11.0
  - federation: 1.11.0
  - files: 1.16.0
  - files_external: 1.12.0
  - files_pdfviewer: 2.1.0
  - files_rightclick: 1.0.0
  - files_sharing: 1.13.1
  - files_trashbin: 1.11.0
  - files_versions: 1.14.0
  - files_videoplayer: 1.10.0
  - firstrunwizard: 2.10.0
  - logreader: 2.6.0
  - lookup_server_connector: 1.9.0
  - mail: 1.9.5
  - nextcloud_announcements: 1.10.0
  - notifications: 2.9.0
  - oauth2: 1.9.0
  - password_policy: 1.11.0
  - photos: 1.3.0
  - privacy: 1.5.0
  - provisioning_api: 1.11.0
  - recommendations: 1.0.0
  - richdocuments: 4.1.1
  - richdocumentscode: 6.4.806
  - serverinfo: 1.11.0
  - settings: 1.3.0
  - sharebymail: 1.11.0
  - support: 1.4.0
  - survey_client: 1.9.0
  - systemtags: 1.11.0
  - text: 3.2.0
  - theming: 1.12.0
  - twofactor_backupcodes: 1.10.0
  - updatenotification: 1.11.0
  - user_status: 1.1.1
  - viewer: 1.5.0
  - weather_status: 1.1.0
  - workflowengine: 2.3.0
Disabled:
  - admin_audit
  - bruteforcesettings
  - calendar
  - dashboard
  - encryption
  - files_fulltextsearch
  - fulltextsearch
  - fulltextsearch_elasticsearch
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "https:\/\/cloud.example.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "21.0.2.1",
        "overwrite.cli.url": "https:\/\/cloud.example.com",
        "overwritehost": "cloud.example.com",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "loglevel": 0,
        "app_install_overwrite": [
            "fulltextsearch",
            "fulltextsearch_elasticsearch",
            "files_fulltextsearch"
        ],
        "theme": ""
    },
    "apps": {
        "accessibility": {
            "enabled": "yes",
            "installed_version": "1.7.0",
            "types": ""
        },
        "activity": {
            "enabled": "yes",
            "installed_version": "2.14.3",
            "types": "filesystem"
        },
        "backgroundjob": {
            "lastjob": "409"
        },
        "bruteforcesettings": {
            "enabled": "no",
            "installed_version": "2.0.1",
            "types": ""
        },
        "calendar": {
            "enabled": "no",
            "installed_version": "2.2.0",
            "types": ""
        },
        "cloud_federation_api": {
            "enabled": "yes",
            "installed_version": "1.4.0",
            "types": "filesystem"
        },
        "comments": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": "logging"
        },
        "contacts": {
            "enabled": "yes",
            "installed_version": "3.5.1",
            "types": "dav"
        },
        "contactsinteraction": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "dav"
        },
        "core": {
            "installed.bundles": "[\"CoreBundle\"]",
            "installedat": "1588327339.9758",
            "lastcron": "1622458411",
            "lastupdateResult": "[]",
            "lastupdatedat": "1622458410",
            "moveavatarsdone": "yes",
            "oc.integritycheck.checker": "[]",
            "previewsCleanedUp": "1",
            "public_files": "files_sharing\/public.php",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "theming.variables": "b92d206521717ac032f8aa58d3c7ff2f",
            "vendor": "nextcloud"
        },
        "dashboard": {
            "enabled": "no",
            "installed_version": "7.0.0",
            "types": ""
        },
        "dav": {
            "buildCalendarReminderIndex": "yes",
            "buildCalendarSearchIndex": "yes",
            "chunks_migrated": "1",
            "enabled": "yes",
            "installed_version": "1.17.1",
            "regeneratedBirthdayCalendarsForYearFix": "yes",
            "types": "filesystem"
        },
        "documentserver_community": {
            "enabled": "no",
            "installed_version": "0.1.7",
            "types": "filesystem"
        },
        "federatedfilesharing": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": ""
        },
        "federation": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": "authentication"
        },
        "files": {
            "cronjob_scan_files": "500",
            "enabled": "yes",
            "installed_version": "1.16.0",
            "types": "filesystem"
        },
        "files_external": {
            "enabled": "yes",
            "installed_version": "1.12.0",
            "types": "filesystem",
            "user_certificate_scan": "not-run-yet"
        },
        "files_fulltextsearch": {
            "enabled": "no",
            "installed_version": "21.0.0",
            "types": "filesystem"
        },
        "files_fulltextsearch_tesseract": {
            "enabled": "no",
            "installed_version": "1.4.1",
            "types": ""
        },
        "files_pdfviewer": {
            "enabled": "yes",
            "installed_version": "2.1.0",
            "types": ""
        },
        "files_rightclick": {
            "enabled": "yes",
            "installed_version": "1.0.0",
            "types": ""
        },
        "files_sharing": {
            "enabled": "yes",
            "installed_version": "1.13.1",
            "types": "filesystem"
        },
        "files_trashbin": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": "filesystem,dav"
        },
        "files_versions": {
            "enabled": "yes",
            "installed_version": "1.14.0",
            "types": "filesystem,dav"
        },
        "files_videoplayer": {
            "enabled": "yes",
            "installed_version": "1.10.0",
            "types": ""
        },
        "firstrunwizard": {
            "enabled": "yes",
            "installed_version": "2.10.0",
            "types": "logging"
        },
        "fulltextsearch": {
            "app_navigation": "0",
            "cron_err_reset": "1602103243",
            "enabled": "no",
            "installed_version": "21.0.0",
            "provider_indexed": "{\"files\":\"1\"}",
            "search_platform": "OCA\\FullTextSearch_ElasticSearch\\Platform\\ElasticSearchPlatform",
            "types": ""
        },
        "fulltextsearch_elasticsearch": {
            "analyzer_tokenizer": "standard",
            "elastic_host": "http:\/\/elasticsearch:9200",
            "elastic_index": "fulltextsearch",
            "enabled": "no",
            "installed_version": "21.0.0",
            "types": ""
        },
        "logreader": {
            "enabled": "yes",
            "installed_version": "2.6.0",
            "types": ""
        },
        "lookup_server_connector": {
            "enabled": "yes",
            "installed_version": "1.9.0",
            "types": "authentication"
        },
        "mail": {
            "enabled": "yes",
            "installed_version": "1.9.5",
            "types": ""
        },
        "nextcloud_announcements": {
            "enabled": "yes",
            "installed_version": "1.10.0",
            "pub_date": "Thu, 24 Oct 2019 00:00:00 +0200",
            "types": "logging"
        },
        "notifications": {
            "enabled": "yes",
            "installed_version": "2.9.0",
            "types": "logging"
        },
        "oauth2": {
            "enabled": "yes",
            "installed_version": "1.9.0",
            "types": "authentication"
        },
        "onlyoffice": {
            "DocumentServerInternalUrl": "",
            "DocumentServerUrl": "https:\/\/cloud.example.com\/apps\/documentserver_community\/",
            "StorageUrl": "",
            "defFormats": "{\"doc\":true,\"docx\":true,\"odp\":true,\"ods\":true,\"odt\":true,\"ppt\":true,\"pptx\":true,\"xls\":true,\"xlsx\":true}",
            "demo": "{\"available\":true,\"enabled\":false,\"start\":{\"date\":\"2020-08-29 07:24:41.358832\",\"timezone_type\":3,\"timezone\":\"UTC\"}}",
            "editFormats": "{\"csv\":true,\"docx\":true,\"odp\":true,\"ods\":true,\"odt\":true,\"pptx\":true,\"rtf\":true,\"txt\":true,\"xlsx\":true}",
            "enabled": "no",
            "installed_version": "4.3.0",
            "jwt_secret": "",
            "sameTab": "true",
            "settings_error": "Mixed Active Content ist nicht m\u00f6glich. HTTPS-Adresse f\u00fcr Document Server ist erforderlich.",
            "types": "filesystem"
        },
        "password_policy": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": "authentication"
        },
        "photos": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": ""
        },
        "privacy": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": ""
        },
        "provisioning_api": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": "prevent_group_restriction"
        },
        "recommendations": {
            "enabled": "yes",
            "installed_version": "1.0.0",
            "types": ""
        },
        "richdocuments": {
            "disable_certificate_verification": "",
            "enabled": "yes",
            "installed_version": "4.1.1",
            "public_wopi_url": "http:\/\/10.9.1.142:8080\/custom_apps\/richdocumentscode\/proxy.php?req=",
            "types": "filesystem,dav,prevent_group_restriction",
            "wopi_url": "https:\/\/cloud.example.com\/custom_apps\/richdocumentscode\/proxy.php?req="
        },
        "richdocumentscode": {
            "enabled": "yes",
            "installed_version": "6.4.806",
            "types": ""
        },
        "serverinfo": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": ""
        },
        "settings": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": ""
        },
        "sharebymail": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": "filesystem"
        },
        "spreed": {
            "installed_version": "9.0.3",
            "project_access_invalidated": "1",
            "stun_servers": "***REMOVED SENSITIVE VALUE***",
            "types": "prevent_group_restriction"
        },
        "support": {
            "SwitchUpdaterServerHasRun": "yes",
            "enabled": "yes",
            "installed_version": "1.4.0",
            "types": "session"
        },
        "survey_client": {
            "enabled": "yes",
            "installed_version": "1.9.0",
            "last_report": "{\"id\":\"oc2gjtfja79a\",\"items\":[[\"server\",\"version\",\"19.0.2.2\"],[\"server\",\"code\",\"other\"],[\"server\",\"enable_avatars\",\"yes\"],[\"server\",\"enable_previews\",\"yes\"],[\"server\",\"memcache.local\",\"\\\\OC\\\\Memcache\\\\APCu\"],[\"server\",\"memcache.distributed\",\"none\"],[\"server\",\"asset-pipeline.enabled\",\"no\"],[\"server\",\"filelocking.enabled\",\"yes\"],[\"server\",\"memcache.locking\",\"none\"],[\"server\",\"debug\",\"no\"],[\"server\",\"cron\",\"ajax\"],[\"php\",\"version\",\"7.4.9\"],[\"php\",\"memory_limit\",-1],[\"php\",\"max_execution_time\",3600],[\"php\",\"upload_max_filesize\",2097152],[\"database\",\"type\",\"mysql\"],[\"database\",\"version\",\"10.5.5\"],[\"database\",\"size\",12312576],[\"apps\",\"accessibility\",\"1.5.0\"],[\"apps\",\"activity\",\"2.12.0\"],[\"apps\",\"bruteforcesettings\",\"2.0.0\"],[\"apps\",\"calendar\",\"2.0.4\"],[\"apps\",\"cloud_federation_api\",\"1.2.0\"],[\"apps\",\"comments\",\"1.9.0\"],[\"apps\",\"contacts\",\"3.3.0\"],[\"apps\",\"contactsinteraction\",\"1.0.0\"],[\"apps\",\"dav\",\"1.15.0\"],[\"apps\",\"documentserver_community\",\"disabled\"],[\"apps\",\"federatedfilesharing\",\"1.9.0\"],[\"apps\",\"federation\",\"1.9.0\"],[\"apps\",\"files\",\"1.14.0\"],[\"apps\",\"files_external\",\"1.10.0\"],[\"apps\",\"files_fulltextsearch\",\"1.4.3\"],[\"apps\",\"files_fulltextsearch_tesseract\",\"disabled\"],[\"apps\",\"files_pdfviewer\",\"1.8.0\"],[\"apps\",\"files_rightclick\",\"0.16.0\"],[\"apps\",\"files_sharing\",\"1.11.0\"],[\"apps\",\"files_trashbin\",\"1.9.0\"],[\"apps\",\"files_versions\",\"1.12.0\"],[\"apps\",\"files_videoplayer\",\"1.8.0\"],[\"apps\",\"firstrunwizard\",\"2.8.0\"],[\"apps\",\"fulltextsearch\",\"1.4.2\"],[\"apps\",\"fulltextsearch_elasticsearch\",\"1.5.2\"],[\"apps\",\"logreader\",\"2.4.0\"],[\"apps\",\"lookup_server_connector\",\"1.7.0\"],[\"apps\",\"mail\",\"1.4.1\"],[\"apps\",\"nextcloud_announcements\",\"1.8.0\"],[\"apps\",\"notifications\",\"2.7.0\"],[\"apps\",\"oauth2\",\"1.7.0\"],[\"apps\",\"onlyoffice\",\"disabled\"],[\"apps\",\"password_policy\",\"1.9.1\"],[\"apps\",\"photos\",\"1.1.0\"],[\"apps\",\"privacy\",\"1.3.0\"],[\"apps\",\"provisioning_api\",\"1.9.0\"],[\"apps\",\"recommendations\",\"0.7.0\"],[\"apps\",\"richdocuments\",\"disabled\"],[\"apps\",\"richdocumentscode\",\"disabled\"],[\"apps\",\"serverinfo\",\"1.9.0\"],[\"apps\",\"settings\",\"1.1.0\"],[\"apps\",\"sharebymail\",\"1.9.0\"],[\"apps\",\"spreed\",\"9.0.3\"],[\"apps\",\"support\",\"1.2.1\"],[\"apps\",\"survey_client\",\"1.7.0\"],[\"apps\",\"systemtags\",\"1.9.0\"],[\"apps\",\"text\",\"3.0.1\"],[\"apps\",\"theming\",\"1.10.0\"],[\"apps\",\"twofactor_backupcodes\",\"1.8.0\"],[\"apps\",\"updatenotification\",\"1.9.0\"],[\"apps\",\"viewer\",\"1.3.0\"],[\"apps\",\"workflowengine\",\"2.1.0\"],[\"stats\",\"num_files\",21555],[\"stats\",\"num_users\",2],[\"stats\",\"num_storages\",5],[\"stats\",\"num_storages_local\",2],[\"stats\",\"num_storages_home\",3],[\"stats\",\"num_storages_other\",0],[\"stats\",\"num_comments\",0],[\"stats\",\"num_comment_markers\",0],[\"stats\",\"num_systemtags\",0],[\"stats\",\"num_systemtags_mappings\",0],[\"files_sharing\",\"num_shares\",9],[\"files_sharing\",\"num_shares_user\",4],[\"files_sharing\",\"num_shares_groups\",0],[\"files_sharing\",\"num_shares_link\",5],[\"files_sharing\",\"num_shares_link_no_password\",5],[\"files_sharing\",\"num_fed_shares_sent\",0],[\"files_sharing\",\"num_fed_shares_received\",0],[\"files_sharing\",\"permissions_3_1\",\"1\"],[\"files_sharing\",\"permissions_3_4\",\"1\"],[\"files_sharing\",\"permissions_3_17\",\"2\"],[\"files_sharing\",\"permissions_0_31\",\"4\"],[\"files_sharing\",\"permissions_3_31\",\"1\"],[\"encryption\",\"enabled\",\"no\"],[\"encryption\",\"default_module\",\"no\"]]}",
            "last_sent": "1602267848",
            "types": ""
        },
        "systemtags": {
            "enabled": "yes",
            "installed_version": "1.11.0",
            "types": "logging"
        },
        "text": {
            "enabled": "yes",
            "installed_version": "3.2.0",
            "types": "dav"
        },
        "theming": {
            "enabled": "yes",
            "installed_version": "1.12.0",
            "types": "logging"
        },
        "twofactor_backupcodes": {
            "enabled": "yes",
            "installed_version": "1.10.0",
            "types": ""
        },
        "updatenotification": {
            "bruteforcesettings": "2.0.1",
            "contacts": "3.4.0",
            "core": "19.0.4.2",
            "enabled": "yes",
            "files_fulltextsearch": "1.4.3",
            "fulltextsearch": "1.4.2",
            "fulltextsearch_elasticsearch": "1.5.2",
            "installed_version": "1.11.0",
            "mail": "1.4.1",
            "types": "",
            "update_check_errors": "0"
        },
        "user_status": {
            "enabled": "yes",
            "installed_version": "1.1.1",
            "types": ""
        },
        "viewer": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": ""
        },
        "weather_status": {
            "enabled": "yes",
            "installed_version": "1.1.0",
            "types": ""
        },
        "workflowengine": {
            "enabled": "yes",
            "installed_version": "2.3.0",
            "types": "filesystem"
        }
    }
}

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

Are you using encryption: HTTPS TLS 1.3

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

Client configuration

Browser: Firefox

Operating system: Debian 10

Logs

See Nextcloud log below

Web server error log

No relevant log entries since behavior does not result in an Apache error

Nextcloud log (data/nextcloud.log)

``` {"reqId":"2u28YF6p99tLCyRte6fM","level":0,"time":"2021-05-31T11:00:56+00:00","remoteAddr":"172.30.0.5","user":"admin","app":"files_sharing","method":"GET","url":"/apps/files_sharing/publicpreview/CLXez8n3xx6L9bS?fileId=43111&file=/sk-mobile/2021_05_30-19_25_53_IMG_20210530_192552618.jpg&x=3440&y=1440&a=true","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"21.0.2.1"} {"reqId":"x0YoQVbKmTnh0tNsi0aA","level":0,"time":"2021-05-31T11:00:58+00:00","remoteAddr":"172.30.0.5","user":"admin","app":"contacts","method":"DELETE","url":"/public.php/webdav/sk-mobile/2021_05_29-23_00_40_IMG_20210529_220038285.jpg","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"21.0.2.1"} {"reqId":"x0YoQVbKmTnh0tNsi0aA","level":0,"time":"2021-05-31T11:00:58+00:00","remoteAddr":"172.30.0.5","user":"admin","app":"files_external","method":"DELETE","url":"/public.php/webdav/sk-mobile/2021_05_29-23_00_40_IMG_20210529_220038285.jpg","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"21.0.2.1"} {"reqId":"x0YoQVbKmTnh0tNsi0aA","level":0,"time":"2021-05-31T11:00:58+00:00","remoteAddr":"172.30.0.5","user":"admin","app":"files_sharing","method":"DELETE","url":"/public.php/webdav/sk-mobile/2021_05_29-23_00_40_IMG_20210529_220038285.jpg","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"21.0.2.1"} {"reqId":"x0YoQVbKmTnh0tNsi0aA","level":0,"time":"2021-05-31T11:00:58+00:00","remoteAddr":"172.30.0.5","user":"--","app":"webdav","method":"DELETE","url":"/public.php/webdav/sk-mobile/2021_05_29-23_00_40_IMG_20210529_220038285.jpg","message":{"Exception":"Sabre\\DAV\\Exception\\NotAuthenticated","Message":"No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured","Code":0,"Trace":[{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMethod","class":"Sabre\\DAV\\Auth\\Plugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":456,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["beforeMethod:DELETE",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v1/publicwebdav.php","line":113,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/public.php","line":81,"args":["/var/www/html/apps/dav/appinfo/v1/publicwebdav.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","Line":154,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"21.0.2.1"} {"reqId":"PAaFPsvHBEZYzz3A36d0","level":0,"time":"2021-05-31T11:01:00+00:00","remoteAddr":"172.30.0.5","user":"admin","app":"contacts","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"21.0.2.1"} {"reqId":"PAaFPsvHBEZYzz3A36d0","level":0,"time":"2021-05-31T11:01:00+00:00","remoteAddr":"172.30.0.5","user":"admin","app":"files_external","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"21.0.2.1"} {"reqId":"PAaFPsvHBEZYzz3A36d0","level":0,"time":"2021-05-31T11:01:00+00:00","remoteAddr":"172.30.0.5","user":"admin","app":"files_sharing","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"21.0.2.1"}
</details>

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

XHRDELETEhttps://cloud.example.com/public.php/webdav/sk-mobile/2021_05_29-23_00_40_IMG_20210529_220038285.jpg
[HTTP/2 401 Unauthorized 46ms]


Error: Request failed with status code 401
exports createError.js:16
exports settle.js:17
onreadystatechange xhr.js:62
Viewer.vue:776

</details>
@szaimen szaimen transferred this issue from nextcloud/server May 31, 2021
@beardhatcode beardhatcode added the bug Something isn't working label Jun 11, 2021
@beardhatcode
Copy link
Contributor

beardhatcode commented Jun 11, 2021

Thank you for reporing this @kalsan. I looked in to this and it seems to be caused by a missing Authorisation header when the delete is invoked from the viewer in public mode.

(The authorisation should be ${token}:null base64 encoded, at the moment no Authorisation header is sent, only a
requesttoken)

@beardhatcode
Copy link
Contributor

Pffff, I have been looking in to this a bit, and I think it might be best to call OCA.Files.App.fileList.do_delete("filename"). Or have some other way of reusing the functionality of the files list, there is no need to duplicate the effort of creating those requests. What do you think @szaimen and @skjnldsv ?

on_delete code in nextcloud/server: https://github.com/nextcloud/server/blob/6f894c8748267a7d5119c517a37c117faf142982/apps/files/js/filelist.js#L3096

@beardhatcode beardhatcode changed the title shared by link: deletion of elements possible in list but not in photo viewer Cannot delete file from viewer if opened via "share by link" Jun 11, 2021
@szaimen

This comment was marked as resolved.

@szaimen szaimen added the needs info Not enough information provided label Sep 27, 2022
@mhoff
Copy link

mhoff commented Feb 3, 2023

Hello, I can confirm this issue is still present in NC25 (25.0.3). I have two separate NC instances (one on a shared host, the other on an RPI via nextcloudpi). Both are on 25.0.3. and express the same behavior. Deleting the file from the folder view works fine, but viewing the file and deleting via the context menu results in a basic authorization prompt.

@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of and removed needs info Not enough information provided labels Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants