digitallinguistics / data-explorer

The DLx portal for viewing, searching, and aggregating data
https://data.digitallinguistics.io
MIT License
3 stars 0 forks source link

move all permissions to projects #489

Open dwhieb opened 1 year ago

dwhieb commented 1 year ago

Instead of having to deal with the complex logic of coordinating permissions between projects and languages, move all permissions to the Project. Languages and lexemes will have their permissions set by virtue of the projects they're part of.

This means that any call to the database for a language or lexeme will also involve a call for a project. Down the road, it might be wise to optimize for this by creating a stored procedure that returns a project with any of its items, and/or by caching projects on the server and using an etag to check that it hasn't been updated (again, a stored procedure might be useful for this).

But don't optimize too early. Open an issue for that instead.

dwhieb commented 1 year ago

This won't actually meet the user requirements. Users do need to be able to view language data independently of project data. So for a given lexeme, you need to check whether the user has access to it via either its language or the projects a user has access to.

Users cannot view language data independently of projects. All languages and lexemes need to be associated with at least one project.