-
Notifications
You must be signed in to change notification settings - Fork 356
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
Fix storage_manager_id when adding a new cloud volume #1061
Conversation
Checked commit AparnaKarve@b04abb2 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Thanks @AparnaKarve; I've tested and it works nicely. |
@AparnaKarve this does fix the failing, but this way, the RBAC check is not done. assert_rbac(CloudVolume, Array.wrap(params[:id])) I believe that this code should pass without such issues 🤔 . I'm trying to find out, why is the error happening. EDIT: The class should be probably different, It seems that |
Please, don't remove the check. Fix it by passing in the correct class instead. |
@romanblanco diff --git a/app/controllers/ems_common.rb b/app/controllers/ems_common.rb
index d1c9ee8d4..d510b14ee 100644
--- a/app/controllers/ems_common.rb
+++ b/app/controllers/ems_common.rb
@@ -457,7 +457,7 @@ module EmsCommon
elsif params[:pressed] == "cloud_volume_new"
javascript_redirect :controller => "cloud_volume",
:action => "new",
- :storage_manager_id => find_id_with_rbac(CloudVolume, params[:id])
+ :storage_manager_id => find_id_with_rbac(ExtManagementSystem, params[:id])
elsif params[:pressed] == "cloud_volume_attach"
javascript_redirect :controller => "cloud_volume",
:action => "attach", |
Oh well, this is the redirect code only. If we have RBAC handled correctly on the receiving side -- |
Yes, this code is used just to pre-set the storage manager for which cloud volumes are currently being displayed. This can be seen at ~2:05 in this video: https://xlab.koofr.net/links/f1bc8422-1606-4652-8ee7-dff76dd8339d (the storage manager is set and disabled based on the The receiving end uses if params[:storage_manager_id]
@storage_manager = find_record_with_rbac(ExtManagementSystem, params[:storage_manager_id])
end |
Thanks, @gberginc! @romanblanco, @AparnaKarve : can you, please, fix this as @gberginc indicated? Thx! |
@martinpovolny @romanblanco, As @gberginc indicated, the receiving end already does the So the way I see it, there is no reason to duplicate |
@martinpovolny bump! This should be categorized as a blocker because: |
Fix storage_manager_id when adding a new cloud volume (cherry picked from commit f491b45) https://bugzilla.redhat.com/show_bug.cgi?id=1445111
Fine backport details:
|
The error below is seen when a new Cloud Volume is added from the Storage Manager Summary screen,
Issue introduced in 9f513f9
@romanblanco Please review.
https://bugzilla.redhat.com/show_bug.cgi?id=1445095