-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[refactor] Unify the export of user data via API #15144
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.
Generally go prefers the context of an operation to be the first argument to a function - which would suggest that the doer
should be the first argument - however, I can see how confusing that would be.
My suspicion is that instead of passing round a *models.User
as the doer
it should be some kind of context (this could even be a context.Context
which just gets cast as a grant/permission context or uses GetValue(...)
to get the grant/permission context from it) which expresses the permissions complex for actions - however, we do no have a consistent system for this kind of thing at present.
Therefore I approve this as it is clearly less confusing than our current crap.
this make sure no private information is leaked by accident
close #14446