Objective
Allow the administrator to upload their profile picture from the admin panel.
It is not required to display it in the UI; it is sufficient to store it in MinIO.
Displaying the image can be handled in a separate issue.
Approach
The administrator is a User with roles.
No new domain logic should be created.
The existing UploadAvatar service from the identity/users module must be reused.
Scope
1. Sidebar
Add a new section “Profile” in the admin sidebar that redirects to the profile page.
2. Profile Page
Create profile.html in:
It must:
- Display the basic admin data (email).
- Allow uploading an image using
multipart/form-data.
3. Handlers
Location:
web/admin/api/handler
Create:
ProfilePage: renders the view.
UploadAvatar: processes the form and calls UserSrv.UploadAvatar.
- Code example:
pkg/identity/users/handler/upload_avatar.go
4. Upload
- Retrieve the
userID from the claims (injected by the Authorize middleware).
- Redirect back to the profile page after the upload.
5. Security
Protect the routes with:
Expected Result
The admin can access Profile, upload an avatar, and update their profile image.
Notes
- Questions or better solutions should be discussed in the issue comments.
Objective
Allow the administrator to upload their profile picture from the admin panel.
It is not required to display it in the UI; it is sufficient to store it in MinIO.
Displaying the image can be handled in a separate issue.
Approach
The administrator is a User with roles.
No new domain logic should be created.
The existing
UploadAvatarservice from theidentity/usersmodule must be reused.Scope
1. Sidebar
Add a new section “Profile” in the admin sidebar that redirects to the profile page.
2. Profile Page
Create
profile.htmlin:web/admin/templatesIt must:
multipart/form-data.3. Handlers
Location:
web/admin/api/handlerCreate:
ProfilePage: renders the view.UploadAvatar: processes the form and callsUserSrv.UploadAvatar.pkg/identity/users/handler/upload_avatar.go4. Upload
userIDfrom the claims (injected by theAuthorizemiddleware).5. Security
Protect the routes with:
Authorize(already implemented) →RequirePermissions(PAdminAccess)(if issue Create permission middleware for templates #28 is resolved)Expected Result
The admin can access Profile, upload an avatar, and update their profile image.
Notes