Fixing inconsistent behavior in way of setting a template as featured

Problem

Admin is able to set a template as "Featured" when creating a template (CreateTemplate) or modifying a template (UpdateTemplatePermission)

 

Regular users are unable to set a template as "Featured" during creation but can set it later by editing the template.

Steps to Reproduce the problem

As Domain admin /user try the following:

 

1. Create a VM

2. Stop the VM

3. Created template with featured flag with using 'createTemplate' API call using the VM's root disk.

  1. Template is created with featured flag set as false.
  2. Update the template to set the featured flag a true using API call 'updateTemplatepermissions'
  3. Template is  now featured

Root Cause

Admin user has permission to set the template as featured either while creating the template (api:createTemplate) or by updating the existing template (api:updateTemplatePermissions).

But Normal user or Domain admin has no permissions to create the template as featured. But normal user or domain admin  can update that template afterwards  and make it featured which is wrong or inconsistent behavior.

Required Modification

 

ACP code has been fixed  not  to allow normal user or domain admin to set the template as featured while creating or while updating

Reason for Modification

 

There was a flaw in granting template permission for different levels of users.

Resolution/Workaround

Not allowing normal user or domain admin to set the template as featured while creating or while updating

Verification

1. Create a VM

2. Stop the VM

3. Created template with featured flag with using 'createTemplate' API call using the VM's root disk.

  1. Template is created with featured flag set as false.
  2. Update the template to set the featured flag a true using API call 'updateTemplatepermissions'
  3. API call would fail.

Impact on Existing System

 

Domain admins and users no longer can set a template as featured. 

Potential Adverse Effect

 

There is no known adverse effect on the system.

Document ID:
214437286

Product:
CloudPlatform

Version:
4.5.1.0

Reference Jira ID:
CS-46718

 
Have more questions? Submit a request

Comments