Created attachment 1351655 [details] setownership Description of problem: Version-Release number of selected component (if applicable): 5.9.0.8.20171109215303_ed87902 How reproducible: Steps to Reproduce: 1. As admin, Create a catalog item for any provider and order. 2. Navigate to MyService . Select service and then set ownership. 3. Message is displayed : " None of the selected items allow ownership changes" Actual results: Able to set ownership from SUI. Expected results: Should be able to set ownership. Additional info:
If this really is a problem, then this is a backend problem. It's the model(s) behind, that informs the UI that the item in question wouldn't allow ownership change. Should the model allow it, UI would change the ownership just fine.
Milan - Can you point to the UI code that is making this decision? What backend method(s) is it using to determine this. (I looked at a similar issue with some guidance from Harpreet recently and it not find any changes in the backend between two versions that worked.) Did the UI requirements change for this recently?
Actually, it seems you're right. First glance at the UI code: app/controllers/mixins/actions/vm_actions/ownership.rb ... def filter_ownership_items(klass, ownership_ids) records = find_records_with_rbac(klass.order(:name), ownership_ids) records.with_ownership if klass.respond_to?(:with_ownership) end might suggest that this indeed is a backend problem, but come to think of it, this is probably just badly written (or refactored) code. Correct logic should probably be: def filter_ownership_items(klass, ownership_ids) records = find_records_with_rbac(klass.order(:name), ownership_ids) if klass.respond_to?(:with_ownership) records.with_ownership if klass.respond_to?(:with_ownership) else records end end i.e. if the class in question (Service, Vm, Template, OrchestrationStack) has with_ownership method, we should do further filtering. Currently, records.with_ownership if klass.respond_to?(:with_ownership) would return nil in case the class doesn't support with_ownership -> on ownersip operation happens. I'll fix this in the UI.
https://github.com/ManageIQ/manageiq-ui-classic/pull/2725
New commit detected on ManageIQ/manageiq-ui-classic/master: https://github.com/ManageIQ/manageiq-ui-classic/commit/814a12c78c04487e304d13ddc953cea0db0125f6 commit 814a12c78c04487e304d13ddc953cea0db0125f6 Author: Milan Zazrivec <mzazrivec> AuthorDate: Tue Nov 14 15:35:23 2017 +0100 Commit: Milan Zazrivec <mzazrivec> CommitDate: Wed Nov 15 13:52:49 2017 +0100 Fix logic for service ownership The broken logic would return nil in case the class in question (Service, Vm, Template ...) doesn't support (respond to) with_ownership class method -> this would seem like the class in question doesn't support ownership change. https://bugzilla.redhat.com/show_bug.cgi?id=1512644 app/controllers/mixins/actions/vm_actions/ownership.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)