Honour listall param for list templates api (#9300)

* Honour listall param for list templates api

* Don't show templates from another project inside a project view
This commit is contained in:
Vishesh 2024-06-26 12:09:56 +05:30 committed by GitHub
parent dc74d5ba88
commit 4f85c3fd23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 3 deletions

View File

@ -4348,7 +4348,7 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
Account caller = CallContext.current().getCallingAccount();
Long parentTemplateId = cmd.getParentTemplateId();
boolean listAll = false;
boolean listAll = cmd.listAll();
if (templateFilter != null && templateFilter == TemplateFilter.all) {
if (caller.getType() == Account.Type.NORMAL) {
throw new InvalidParameterValueException("Filter " + TemplateFilter.all + " can be specified by admin only");

View File

@ -2276,11 +2276,16 @@ export default {
}
args.zoneid = _.get(this.zone, 'id')
args.templatefilter = templateFilter
if (this.$store.getters.project?.id) {
args.projectid = this.$store.getters.project.id
} else {
args.projectid = -1
}
args.details = 'all'
args.showicon = 'true'
args.id = this.templateId
args.isvnf = false
args.listall = true
return new Promise((resolve, reject) => {
api('listTemplates', args).then((response) => {
@ -2299,10 +2304,15 @@ export default {
}
args.zoneid = _.get(this.zone, 'id')
args.isoFilter = isoFilter
if (this.$store.getters.project?.id) {
args.projectid = this.$store.getters.project.id
} else {
args.projectid = -1
}
args.bootable = true
args.showicon = 'true'
args.id = this.isoId
args.listall = true
return new Promise((resolve, reject) => {
api('listIsos', args).then((response) => {

View File

@ -46,6 +46,9 @@
:os-name="item.osName" />
 
{{ item.displaytext }}
<span v-if="item?.projectid">
| <project-outlined /> {{ item.project }}
</span>
</a-radio>
</a-radio-group>
</a-list-item>