trilium icon indicating copy to clipboard operation
trilium copied to clipboard

Milestone: Multi-user support

Open meichthys opened this issue 2 years ago • 65 comments

Issuehunt badges

Many feature requests and issues exist for multiple user support. Some of the most relevant issues in the original Trilium repo are: (https://github.com/zadam/trilium/issues/3546, https://github.com/zadam/trilium/discussions/1375, https://github.com/zadam/trilium/issues/2679, https://github.com/zadam/trilium/issues/2143, https://github.com/zadam/trilium/issues/2109, https://github.com/zadam/trilium/issues/1527, https://github.com/zadam/trilium/issues/1436, https://github.com/zadam/trilium/issues/964, https://github.com/zadam/trilium/issues/600, https://github.com/zadam/trilium/issues/450, https://github.com/zadam/trilium/issues/169)

Instead of migrating each of the issues, we will link to them here, and if desired, Zadam can close the issues on his repo and link to this issue.


IssueHunt Summary

Backers (Total: $622.00)

Submitted pull Requests


Become a backer now!

Or submit a pull request to get the deposits!

Tips

meichthys avatar Apr 16 '24 13:04 meichthys

Does this mean you guys are thinking of adding this feature? If so, is it going to take a few months, or a few years?

phirestalker avatar Jul 06 '24 20:07 phirestalker

Yes, this feature will be eventually added in some form. However, We cannot provide a timeline at this point. Before we start working on feature requests, we will be working on making the app maintainable, so this feature will probably not land within a few months.

meichthys avatar Jul 08 '24 00:07 meichthys

Until this is implemented, some tips and tricks on how to use the existing Trilium with multiple users can be found here: https://github.com/zadam/trilium/discussions/3921

meichthys avatar Aug 05 '24 15:08 meichthys

I really hope Trilium can have this feature, and I hope it can be launched soon.

Hoshino-Yumetsuki avatar Mar 25 '25 14:03 Hoshino-Yumetsuki

@Hoshino-Yumetsuki , it's not going to happen soon unless there is more interest in this feature, in terms of man-power and maybe even a financial incentive.

It's a really big amount of work, we're talking hundreds of hours.

eliandoran avatar Mar 25 '25 15:03 eliandoran

I can't necessarily speak to the wider desire for a more mature user management system other than it would enhance the usability and administration of the product itself. But this is my first time digging through this project and it is solely because I am currently testing various projects to find one that can handle several distinct users. I may keep looking if there is no plan to have this support. Out of curiosity is there already a design of of the systems needing development or a feature roadmap? I am more of a back end c#/sql dev but it does look like the db itself could use some major enhancements to support users and access control. Is the desire to offload functionality away from the sql backend, or to go more in?

uprightbass360 avatar Apr 27 '25 16:04 uprightbass360

Am typing out a more in-depth response, but going to crosslink this discussion thread because it's highly relevant.

dyllan-to-you avatar May 29 '25 20:05 dyllan-to-you

it's not going to happen soon unless there is more interest in this feature, in terms of man-power and maybe even a financial incentive.

It's a really big amount of work, we're talking hundreds of hours.

Hmmm... What financial incentive would you need ? I could sponsor this a bit, and I'm sure I am not the only one.

deajan avatar Oct 02 '25 22:10 deajan

@deajan , I'm thinking of more like a bounty where everyone can donate rather than specifying an amount on my side. Either way, working on such a big feature can realistically only be done if I take some unpaid time off work for a few weeks.

eliandoran avatar Oct 03 '25 14:10 eliandoran

Yep, I thought so. I could go for like 500-600$, but that's far from what is requested. How about you setup that bounty ?

deajan avatar Oct 03 '25 23:10 deajan

@deajan , @meichthys , there you go: https://oss.issuehunt.io/r/TriliumNext/Trilium/issues/4956

eliandoran avatar Oct 08 '25 15:10 eliandoran

Not sure what's going on, but I get this when submitting a bounty payment via normal mastercard:

Image

https://support.stripe.com/questions/3ds-mandate-in-japan?locale=en-GB

If anyone else sees this, we can report it upstream.

meichthys avatar Oct 08 '25 15:10 meichthys

Not sure what's going on, but I get this when submitting a bounty payment via normal mastercard:

Image

https://support.stripe.com/questions/3ds-mandate-in-japan?locale=en-GB

If anyone else sees this, we can report it upstream.

That's really weird, to be honest. If it causes many issues like this, we might as well switch to something else. I'm open to suggestions.

eliandoran avatar Oct 08 '25 17:10 eliandoran

@eitch has funded $2.00 to this issue.


issuehunt-oss[bot] avatar Oct 09 '25 06:10 issuehunt-oss[bot]

@eitch has funded $50.00 to this issue.


issuehunt-oss[bot] avatar Oct 09 '25 06:10 issuehunt-oss[bot]

I just stumbled upon this application and i am blown away at its feature set. You have desktop apps as well and that is awesome. Would love the multi-user feature!

eitch avatar Oct 09 '25 06:10 eitch

@deajan has funded $500.00 to this issue.


issuehunt-oss[bot] avatar Oct 09 '25 06:10 issuehunt-oss[bot]

Maybe we need to make this bounty more public, like put it in the next release announcement or so, in order to gain sufficient traction.

deajan avatar Oct 09 '25 06:10 deajan

@deajan , good point. 👍🏻

eliandoran avatar Oct 09 '25 07:10 eliandoran

@metrax has funded $50.00 to this issue.


issuehunt-oss[bot] avatar Oct 09 '25 17:10 issuehunt-oss[bot]

HI,i will be trying to implement this in parallel and hopefully doing it. https://github.com/Ayushkiller/Trilium I will be constantly pushing changes in stages .Currently i am actively updating some legacies and extending support for the multi user system.Will be releasing a feat 1 for everyone to see on 16 of this month hopefully with some features

Ayushkiller avatar Oct 13 '25 08:10 Ayushkiller

@Ayushkiller , sounds good. However if you wish to receive the bounty we'd have to agree on some rules first. It's best to first provide a technical document with how you plan to implement it. And code quality is also an important factor, for this core functionality it's best not to use LLM code generation.

eliandoran avatar Oct 13 '25 08:10 eliandoran

I'll add a bit about the functional point of view. The basics should be user and group management IMO. The permissions could be as simple as CRUD. The complicated point would be permission inheritance from nodes to sub nodes, but would be necessary in order to only give permissions on one node without the need to actually give permission on each subnode. If "dynamic" inheritance is hard to achieve, a for loop applying parent permissions to sub nodes would also work, but would be less optimal for clones where inheritance would be overwritten if other permissions are given.

Anyway, I hope we'll get the traction to get something. This would allow Trilium to enter the enterprise environments.

deajan avatar Oct 13 '25 10:10 deajan

@eliandoran I mean i was making it regardless.I would also give the technical doc for it soon and was working on it for a while i just found about this one yesterday when skimming through issues.Still deciding on inheritances for subnodes. As far as bounty is concerned.You can always reject my pr if not upto standard.Technical doc will be appended to readme when i push next.

Ayushkiller avatar Oct 13 '25 18:10 Ayushkiller

Hi,

I've just submitted PR #7441 that implements the multi-user support feature requested in this issue.

What's Included:

  • Complete database schema migration (v234) with users, roles, user_roles, and note_shares tables
  • User management service with CRUD operations and password encryption
  • Role-based permission system (Admin/Editor/Reader) with granular access control
  • RESTful API endpoints for user management
  • Updated login flow supporting username/password while maintaining backward compatibility
  • Automatic migration of existing single-user instances to admin user
  • Full TypeScript type definitions

Quality Metrics: ✅ 948 tests passing | 17 skipped (965 total) ✅ Successful builds (server and client) ✅ Zero TypeScript errors ✅ Backward compatible with existing installations

I saw the discussion about bounties and have requested $250 for this work. Happy to discuss if needed.

The PR is ready for review - looking forward to your feedback!

Somoru avatar Oct 21 '25 06:10 Somoru

@Somoru , I'll have a look at it.

eliandoran avatar Oct 21 '25 07:10 eliandoran

@Somoru How does the permission inheritance system work ? Eg create a node, have sub nodes, will the sub nodes inherit node permissions ? Also, what happens with clones ? Will they inherit both "parent" nodes permissions ?

deajan avatar Oct 21 '25 07:10 deajan

@deajan

Current Implementation: Right now, the permission system works at the user role level (Admin/Editor/Reader), not at the individual node level. All nodes are accessible based on the user's role.

Permission Inheritance & Clones: The current PR doesn't implement per-node permissions or inheritance yet. However, I've included a note_shares table in the migration schema that's designed to support this functionality in the future.

If you'd like, I can implement:

  1. Per-node permission inheritance (sub-nodes inherit parent permissions)
  2. Clone permission handling (inherit from both parent branches)
  3. Fine-grained sharing (share specific nodes with specific users)

These additions would significantly expand the scope of work, so I'd update the bounty request to $350 to reflect the additional implementation. Would you like me to add these features to the current PR, or would you prefer to address them separately later?

Somoru avatar Oct 21 '25 07:10 Somoru

@werererer has funded $20.00 to this issue.


issuehunt-oss[bot] avatar Oct 21 '25 12:10 issuehunt-oss[bot]

@eliandoran I have made some changes according to your response and comments. Please check it out

Somoru avatar Oct 21 '25 14:10 Somoru