Skip to content

Conversation

rubenvitt
Copy link
Contributor

... can't be tested well, so please double-check. I'll try to fix, if you find something.

@gmessner
Copy link
Collaborator

Haven't tested yet, but I believe this may fail if the authenticated user is not an administrator. https://docs.gitlab.com/ee/api/custom_attributes.html states the following:

"Every API call to custom attributes must be authenticated as administrator."

Also, I'm not a fan of adding "?with_custom_attributes=true" as part of the path, it should be moved to the query params that are being passed in.

I'm thinking it might be better to make custom attributes a property of the UserApi so that one could enable custom attributes by doing something like this:

gitLabApi.getUserApi().enableCustomAttributes();
List<User> users = gitLabApi.getUserApi().getUsers();

Or on a per call basis like this:

List<User> users = gitLabApi.getUserApi().withCustomAttributes().getUsers();

additionally refactorings for page params
@gmessner
Copy link
Collaborator

@rubenvitt
The changes are very near exactly what I was looking for. If you are done I will go ahead and merge and then make a couple of small tweaks, let me know if it is ready.

@rubenvitt
Copy link
Contributor Author

I think, that's all. :)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants