In this PR, we add some validation logic and rules in both FE and BE to ensure field permissions are handled correctly for relation fields. - (BE) Only one field permission per fieldMetadata is accepted per input. This is already guaranteed in the FE. It was added to help guarantee that, when looking within the field permissions input for a potential field permission on a relationTargetFieldMetadataId for a relation field, there can only be 0 or 1. - (FE) Only field permission with new values are sent to save, to avoid sending contradictory field permissions for related fields. E.g. let's say I have an existing field permission restricting read permission on company's people field. By definition I also have one on person's company field. If I update this field permission to enable the read permission by updating company's people field, in the previous logic I was also going to send for upsert the existing obsolete field permission on person's company. Thus the server does not know which is the right value so we should only send the new value. - (BE) If the server receives two contradictory field permissions on two related fields, e.g. on company's people with canRead = null and person's company with canRead = false, it throws an error.
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See:
🚀 Self-hosting
🖥️ Local Setup
Does the world need another CRM?
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in Open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Recoil, Emotion and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!




