-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: support for user linked project permissions #147
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, but isn't this currently still missing the core of the logic, i.e. that the project field is used to filter out docs during replication?
Or can "projects" now somehow be used in configured rules?
const user = await firstValueFrom( | ||
this.couchdbService.get('app', data['username']), | ||
).catch(() => {}); | ||
|
||
return new UserInfo( | ||
data.username, | ||
data['_couchdb.roles'], | ||
user && user['projects'] ? user['projects'] : [], | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small code block, but also for future proofing I would suggest we put the UserInfo creation in a service rather than duplicate it.
Okay, understood now that this simply works out of the box 😄
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Could still remove that code duplication here #147 (comment)
but we can also do this once we touch that code again.
related: https://github.com/Aam-Digital/internal/issues/21