tracks icon indicating copy to clipboard operation
tracks copied to clipboard

shared items among users - new functionality proposal/request

Open ghost-from-the-past opened this issue 3 years ago • 2 comments

Dear developers as far I understand all the content of the database is encapsulated by user_id, different user don't have access to context, projects, tags, etc... of other users. Is there currently a way to share this database items among users ?

If not, could be possible to use user_id=0 or NULL as a "share" flag ? so when the object belongs to user_id=0 or NULL is accessible to any user. (this option does not require to touch the database tables structure, but requires to touch the code to search for user_id and user_id=0)

or add another field in the tables to indicate that any user can access the object (this option requires to touch the database tables structure to add and extra field in a lot of tables + touch the code to search for user_id and the flag)

another option is to not touch the tables but add a new table as level of indirection. In this approach the actual fields user_id are not any more the direct real user but is now a group_id. The new table contains the indirection pairs user_id <--> group_id. The actual case is a simple relation 1 to 1, group_id and user_id are the same. Everything continues as before, no code change, except the extra table to translate user_id to group_id. Fully backwards compatible. This will require a new dialogs to handle the group creations and the assignation of user_id to a group_id. And there are no more complexity as you restraint each user_id to belong to only one group_id (a group_id can have several users but a user can NOT be in several groups).

Going for a user_id belonging to several groups will require code modifications in the search with multiple key.

I hope you get the idea Regards Daniel

ghost-from-the-past avatar Apr 15 '21 15:04 ghost-from-the-past

Similar (but not same) functionality has already been suggested in some other issues in the ”multi-user” label: https://github.com/TracksApp/tracks/labels/multi-user

It's unlikely I would have time to work towards implementing this, because there are other issues which are IMO more pressing. However, if someone were to work on this, I'd gladly contribute to the planning of the feature and if it fits the bill, also merge it to our codebase. Let me know if you're interested in working towards implementing this kind of functionality.

ZeiP avatar Apr 15 '21 15:04 ZeiP

ah ha ha! now I understand what the label multi-user refers to ...

You are right, your priorities first. Unfortunately my skills on Ruby are non existent. I'll try to read and learn, will see where that takes me.

After reading the titles of several of the request with the label "multi-user" I guess that the my proposal to add a table as indirection for group_id and user_id will fulfill the majority of the cases (if not all) and doesn't seems complicated.

Regards Daniel

ghost-from-the-past avatar Apr 15 '21 16:04 ghost-from-the-past