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

Option for Import utility #17

Open
Juergen-aus-Zuendorf opened this issue Sep 12, 2022 · 4 comments
Open

Option for Import utility #17

Juergen-aus-Zuendorf opened this issue Sep 12, 2022 · 4 comments

Comments

@Juergen-aus-Zuendorf
Copy link

Hi,

it would be a great advantage to be able to import pages not only with admin rights, but with a special role defined only for this purpose.
Does anyone perhaps have an idea how this could be easily implemented?

Best regards
Juergen

@fiwswe
Copy link
Contributor

fiwswe commented Sep 12, 2022

Can you describe your use case a bit more?

What would be the advantage compared to just creating the page in the normal way? You already have admin rights if you are using the Advanced Plugin so you should be able to create any page in any namespace. Copy/paste the page content if you already have it in a text file, save and you're done.

Also, why should this be part of the Advanced Plugin? It's about DW configuration settings not content. You could (should) have a completely separate Plugin für an import functionality if that has any merit.

But back to your question: An implementation would require some UI to specify and upload the text file, UI to specify the page id and a button to trigger the action.
The code would then need to upload the file, copy it to …/data/pages/<page-id>.txt and call the URL <dokuwiki-base-url>/lib/exe/taskrunner.php?id=<page-id> to trigger fixing up meta data, search index and the sitemap. Keep in mind that <page-id> might contain namespaces as well, e.g. playground:example.

Next you'll probably want the same thing for images (media) as well? Oops, I missed your #14 ;-)

@Juergen-aus-Zuendorf
Copy link
Author

My problem is the following:

We let translate German pages as a collection of certain files that are contained in different namespaces. We then receive the foreign language files back from the translation agency in an identical namespace structure. I import these pages via the import function of the Advanced plug-in. However, this is exactly the kind of work I would assign to a non-administrator.

@fiwswe
Copy link
Contributor

fiwswe commented Sep 13, 2022

@Juergen-aus-Zuendorf
Ok, sorry, I misunderstood your issue. You want the existing import functionality, but for non-admin but selectable users/groups?

Then the problem broils down to:

  • Currently the Import UI is normally visible for Admins only. It would need to appear somewhere where it is visible for non-admin users who have that right assigned to them.

I think this can be done by setting the DW configuration option manager to include, e.g. the group @managers and then assigning this group to the users in question. When I tested this, the Import/Export UI became visible in the DW Admin area for a user that was not a DW Admin, only a member of the mentioned group.

Does this help?

@Juergen-aus-Zuendorf
Copy link
Author

Very good, thank you !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants