Skip to content

Sync media fails if remoteuser has no permission to [root] #56

@eduardomozart

Description

@eduardomozart

I installed this plug-in in secondary wikis to sync the content (pages/media) from a primary wiki.
The sync works just fine for pages, but it fails for media files with the message:

transport error - HTTP status 403

It's a SSL connection and the primary wiki certificate is a valid certificate from Let's Encrypt, and the Pages were syncing normally, so I believe it was a problem related to permissions and added the remoteuser group with "read" access to [root] and the Media syncing started working normally. But I do not want that the remoteuser have read-only access to all primary wiki content, only to some pages.

So I started tweaking the admin.php source code for a bit and commited a dirty workaround to allow Media sync listing first the pages that the user has access and pulling the attachments from it. It's not fail proof, because maybe there's Media hosted on locations where there's no Page created, so it will not be synced.

I believe there's some kind of ACL protection that is generating a bug-like behavior, because when using dokuwiki.getAttachments function with no namespace, it still should be possible listing the Media attachments that user has access instead of closing the connection unexpectedly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions