Skip to content
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

Template based on related data? #55

Open
sandermarechal opened this issue Nov 6, 2024 · 2 comments
Open

Template based on related data? #55

sandermarechal opened this issue Nov 6, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@sandermarechal
Copy link

Is it possible to filter/template based on related data? Here is my use-case. Suppose I have an M:N user-group relation like so:

users:
* id (int)
* username (varchar)
* password_hash (varchar)

groups:
* id (int)
* name (varchar)
* anonymize (bool)

user_group:
* user_id (int)
* group_id (int)

Now, I want to anonymize all users, except if they belong to a group that has anonymize: false. Is that possible?

@borisershov
Copy link
Member

Hi! To make sure I understand your issue, could you provide an example with data and result you expect after anonymization?

@sandermarechal
Copy link
Author

Sure. Before anonymization:

users

id username password_hash
1 joe xxxx
2 jack xxxx
3 amy xxxx
4 alexa xxxx

groups

id name anonymize
1 users 1
2 admins 0

user_group

user_id group_id
1 1
2 1
2 2
3 1
4 2

So, jack is both a user and admin, and alexa is just an admin. Want to anonymize like so:

users

id username password_hash
1 user_1 anonymized
2 jack xxxx
3 user_3 anonymized
4 alexa xxxx

(the other tables remain the same)

The use case is that we provide anonymized QA environments to our clients, but the people in the admin group still need to be able to login in order to test the QA environment.

@sofanixys sofanixys added the enhancement New feature or request label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants