You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/05/23 13:19:32 UTC

[GitHub] rafaelweingartner commented on issue #2666: Non-admin User receives an error message when entering disk offering section of create instance wizard

rafaelweingartner commented on issue #2666: Non-admin User receives an error message when entering disk offering section of create instance wizard
URL: https://github.com/apache/cloudstack/issues/2666#issuecomment-391343597
 
 
   @PaulAngus I just built the 4.11 (commit: eb23d91cf465c13e79e7b612258e9614669de7c9), and indeed this error happens there. However, it does not seem to be a result of PR #2639.  As you can see, with PR #2639, I did a small amend in `com.cloud.api.query.QueryManagerImpl.searchForVolumesInternal(ListVolumesCmd)`. However, the internal method use by the `listTemplates` API method is `com.cloud.api.query.QueryManagerImpl.searchForTemplatesInternal(ListTemplatesCmd)`, which has not been touched by PR #2639. 
   
   If we look a little closer, we can see the validation at line 3044 that is throwing the message you see. Therefore, the user is a normal one (as described in your test case) and the `templateFilter == TemplateFilter.all`. Now, if we take a look at `instanceWizard.js`, we can see at line 392 that, for all users, it is being used `templatefilter: 'all'`. This is the problem, according to `listTemplates` API method documentation, the `all` filter should only be used by admins; hence the validation and exception that is being thrown. I have no idea how we have not seen this before.
   
   Now, how to fix it? I understand that for admins we can keep using the `all` flag. However, for normal users we should use something else. Reading the `listTemplats` API method documentation, it feels that we should us `executable` as the `templatefilter`. What do you think?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services