Skip to content

feat: user management api#302

Merged
mini-bomba merged 6 commits into
mainfrom
feat/user-management-api
Jun 8, 2026
Merged

feat: user management api#302
mini-bomba merged 6 commits into
mainfrom
feat/user-management-api

Conversation

@lolakk05

Copy link
Copy Markdown
Contributor

I tested a few functionalities:

  • solvro_admin can change other users permissions, roles
  • user cant change their own roles/permissions.

@lolakk05 lolakk05 requested a review from mini-bomba May 15, 2026 16:02
@lolakk05 lolakk05 self-assigned this May 15, 2026
@lolakk05 lolakk05 requested a review from a team as a code owner May 15, 2026 16:02
@lolakk05 lolakk05 linked an issue May 15, 2026 that may be closed by this pull request
@github-actions

Copy link
Copy Markdown
Contributor

Looks like you did not link an issue to this PR. If this PR completes a task, consider linking it.

@lolakk05

lolakk05 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

aha i tak chyba źle podpiałem issue

@mini-bomba

Copy link
Copy Markdown
Member

the workflow that reminds you to link issues only looks at your pull request's description, so it only checks for issues linked with keywords, not manually
iirc github doesn't make it that easy to figure out which issues are linked manually (well they don't make it easy to check for keyword-linked issues either, but at least they make the list of valid keywords public)

@mini-bomba

Copy link
Copy Markdown
Member

also you don't need to manually request reviews on our repos, github automatically requests reviews from appropriate users/teams based on the codeowners file we've created

@mini-bomba mini-bomba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah no, this aint finished at all

Comment thread app/controllers/v1/permissions.ts Outdated
Comment thread app/controllers/v1/users.ts
Comment thread app/models/user.ts Outdated
@pull-request-size pull-request-size Bot added size/L and removed size/M labels May 15, 2026

@mini-bomba mini-bomba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

only general review pass for now, focusing on the source of your lint issues and possible api design problems

Comment thread app/controllers/v1/users.ts Outdated
Comment on lines +54 to +55
const page = request.input("page", 1) as number;
const limit = request.input("limit", 10) as number;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do not use input/param, validate everything (applies to the entire file)

Comment thread app/controllers/v1/users.ts Outdated
Comment on lines +64 to +65
async findOne({ request, auth }: HttpContext) {
await this.requireSuperUserOrSelf(auth, parseInt(request.param("id")));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think it would be more reasonable to have an endpoint such as /users/me rather than allowing the user to get "get" themselves using the standard endpoint if they know their own id
also we might already have such an endpoint, in the auth controller...

Comment thread app/controllers/v1/users.ts Outdated
Comment thread app/controllers/v1/users.ts Outdated
}

async update({ request, auth }: HttpContext) {
await this.requireSuperUserOrSelf(auth, parseInt(request.param("id")));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

and also be careful with what the user can update themselves
tbh i think they should only be able to edit their own password, and we likely have such a method in the auth controller already

Comment thread app/models/user.ts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not needed

@mini-bomba mini-bomba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just some minor comments

Comment thread app/controllers/v1/permissions.ts Outdated
Comment thread app/controllers/v1/users.ts Outdated
@lolakk05 lolakk05 requested a review from mini-bomba June 7, 2026 18:05

@mini-bomba mini-bomba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm 🔥 :shipit:

@mini-bomba mini-bomba added this pull request to the merge queue Jun 8, 2026
Merged via the queue into main with commit 7c83b41 Jun 8, 2026
12 checks passed
@mini-bomba mini-bomba deleted the feat/user-management-api branch June 8, 2026 20:21
krzys13 pushed a commit that referenced this pull request Jun 11, 2026
* feat: user management api

* refactor: user contoller to custom one, transactions"

* fix: lint

* fix: fix: lint

* refactor: changes

* fix: delete endpoint wrap with transactions and arrow function error creation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: user management api

2 participants