[UI] Remove Image button (for custom images) is presented to non-Admin users
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Medium
|
Newell Jensen | ||
2.4 |
Triaged
|
Undecided
|
Unassigned |
Bug Description
When removing a custom image using the "Remove Image" link on the "Images" page - no feedback is given in the UI if this action fails due to lack of permission. After clicking the Remove button to confirm the action, the page stays the same with no feedback and the image is still listed.
An error is logged to the server log but there is no client feedback.
Additionally, the Remove Image link should probably not be presented in such a case.
= Steps to reproduce =
Tested on Bionic, MAAS 2.4.2-7034-
(1) Upload a custom image using the MAAS CLI as a MAAS administrator
maas admin boot-resources create name=windows/
(2) Create a non-admin user, and login to the web interface with it
(3) Browse to the images tab and select the "Remove Image" link
(4) Observe no change in the UI, reload page, the image is still there
(5) Check regiond.log and observe the error below
2018-10-17 12:15:39 maasserver.
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
return target()
File "/usr/lib/
task()
File "/usr/lib/
task()
--- <exception caught here> ---
File "/usr/lib/
result = inContext.theWork()
File "/usr/lib/
inContext.
File "/usr/lib/
return self.currentCon
File "/usr/lib/
return func(*args,**kw)
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
return func_outside_
File "/usr/lib/
return func(*args, **kwargs)
File "/usr/lib/
return func(*args, **kwds)
File "/usr/lib/
assert self.user.
builtins.
Related branches
- Lee Trager (community): Approve
- MAAS Lander: Pending (unittests) requested
-
Diff: 22 lines (+2/-2)1 file modifiedsrc/maasserver/static/partials/boot-images.html (+2/-2)
summary: |
- No UI feedback that removing a custom image failed because the non-admin - user does not have permission + [UI] Remove Image button (for custom images) is presented to non-Admin + users |
Changed in maas: | |
milestone: | none → 2.5.0rc1 |
importance: | Undecided → Medium |
status: | New → Triaged |
tags: | added: ui |
Changed in maas: | |
assignee: | nobody → Newell Jensen (newell-jensen) |
Changed in maas: | |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Andres: While the button shouldn't be there, I feel that the error not being presented is likely also a bug in itself. Should that be a separate bug? Not sure if that's an issue with this specific action or a general issue with surfacing errors back to the client.