Skip to content

Join schemas on different pages #285

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

Open
iainhallam opened this issue Apr 23, 2017 · 1 comment · May be fixed by #691
Open

Join schemas on different pages #285

iainhallam opened this issue Apr 23, 2017 · 1 comment · May be fixed by #691

Comments

@iainhallam
Copy link
Contributor

I'm still trying to set up a user information system using DokuWiki, and it looks as though struct will be the best way to achieve this, but I either need struct to implement allowed viewers for certain schemas or to allow joining data from different pages. It seems to me that adding the management overhead of a second permission system in an external database to this complex setup will be problematic, and still needs code changes, so I suspect it will be more useful to myself and others to be able to use the built-in DokuWiki ACLs to control access to this data.

My current setup is to have a namespace, people: which contains pages for individuals, e.g., people:iain.hallam. I've got a second namespace set up with appropriate ACLs, people:confidential: (with pages, e.g., people:confidential:iain.hallam) so that information stored there can only be seen by users in a group confidential.

I've defined two schemas, person and person_confidential, and assigned them to the appropriate paths, and I can now edit information on both the person page and the confidential page. My problem comes when I want to create an aggregation page (also restricted to the group confidential) that shows public and private information together.

Since the schemas are stored as tables, I'd like to be able to have struct issue a query to join them both:

SELECT * FROM person LEFT JOIN person_confidential ON person.%page% = person_confidential.%page%;

I guess in struct syntax, this would modify the schemas line of the table output syntax somehow? Perhaps

---- struct table ----
schemas: person < person_confidential
join: person.%page% = person_confidential.%page%
cols: *
----

Is this a potential approach or is there a better way of protecting only a portion of struct data for an individual page?

@juliusverrel
Copy link

This would be extremely useful also in the following use case (with multi-valued vield)

  • schema Event with field Projects (multi-valued)
  • schema Project with field Users (mult-valued)
  • left join (Event, Project) would have a field users (or Project.users?), listing for each event all users of any of the projects assigned to this event
  • for instance, this would allow showing each user a list of events related to any of their projects with the following code:
---- struct table ----
schemas: Event < Project
join: Event.Projects ~ Project.ID
cols: Event.*
filter: Project.users ~ CURRENTUSER
----

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

Successfully merging a pull request may close this issue.

3 participants