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

Add field "is_auditor" in user #1981

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions users.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type User struct {
LastActivityOn *ISOTime `json:"last_activity_on"`
ColorSchemeID int `json:"color_scheme_id"`
IsAdmin bool `json:"is_admin"`
IsAuditor bool `json:"is_auditor"`
AvatarURL string `json:"avatar_url"`
CanCreateGroup bool `json:"can_create_group"`
CanCreateProject bool `json:"can_create_project"`
Expand Down
1 change: 1 addition & 0 deletions users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func TestGetUserAdmin(t *testing.T) {
LastActivityOn: &lastActivityOn,
ColorSchemeID: 2,
IsAdmin: true,
IsAuditor: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess you didn't test this 😞 Will add a commit to fix it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, in my case it worked because I used an administrator user. I haven't seens the different behavior on this param between request from admin or non admin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that's the same behavior for is_admin, that is already present

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, the fix was easy.

See #1982 for the details, but running go test./... to run the tests failed without this change.

AvatarURL: "http://localhost:3000/uploads/user/avatar/1/index.jpg",
CanCreateGroup: true,
CanCreateProject: true,
Expand Down
Loading