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 2019/07/09 11:13:29 UTC

[GitHub] [cloudstack] rhtyd opened a new pull request #3241: [WIP DO NOT MERGE] Allow users to share templates with Accounts or Projects through the

rhtyd opened a new pull request #3241: [WIP DO NOT MERGE] Allow users to share templates with Accounts or Projects through the
URL: https://github.com/apache/cloudstack/pull/3241
 
 
   Problem: CloudStack users want the ability to share templates with other accounts or projects through the UI.
   
   Root Cause: The ‘updateTemplatePermissions’ is only available via API and needs to be integrated with the UI in order to allow users to share templates with other accounts within the same domain, and also with projects that the sharing account has access to.
   
   Solution: The CloudStack UI template view has been extended to include a button that allows users to update template permissions through the ‘updateTemplatePermissions’ API. This API supports 3 operations i.e. add, remove or reset. The reset operation does not require any parameters and it simply removes all permissions for a template. The add and remove parameters require either accounts or projects to be specified for sharing or stop sharing templates. The ‘listAccounts’ API has been extended to allow users to see all the accounts within the same domain if the global setting ‘allow.view.all.domain.accounts’ is set to true. This allows the accounts selection to be a multi-selection.
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ## Screenshots (if appropriate):
   Reset Operation hides the Accounts and Project ID fields as this operation does not require any additional parameters to be set.
   
   Operation = Reset; Account and Project fields not displayed
   ![image](https://user-images.githubusercontent.com/19572501/53580791-0c073980-3b85-11e9-949b-57592f4ac6f8.png)
   
   Operation = Add/Remove , global setting: 'allow.user.view.all.domain.accounts' = false;
   ![image](https://user-images.githubusercontent.com/19572501/53580711-e37f3f80-3b84-11e9-9f28-0ddf9ab98d19.png)
   
   Operation = Add , global setting: 'allow.user.view.all.domain.accounts' = true; Domain has 3 accounts in total (bt1, bt2 and bt3). Logged in user is bt1 and so it is not shown on the dropdown list.
   ![image](https://user-images.githubusercontent.com/19572501/53581050-8b950880-3b85-11e9-8c7d-71b5b4b50524.png)
   
   Operation = Remove , global setting: 'allow.user.view.all.domain.accounts' = true; Domain has 3 accounts in total (bt1, bt2 and bt3). The current template was only shared with bt2 by bt1 so dropdown menu only shows accounts that the current template has been shared with.
   ![image](https://user-images.githubusercontent.com/19572501/53581135-b3846c00-3b85-11e9-96d8-a6e0f85a776b.png)
   
   ## How Has This Been Tested?
   - Create 2 Accounts (acc1 and acc2) within the same domain.
   - Log in to the CloudStack UI with acc1 user account and upload a private template for this user.
   - Navigate to the newly created UI and click on the "Update Template Permissions" button.
   - A new window should pop up, select "Add" for this window and input acc2 in the Accounts input field and then click OK.
   - With CloudMonkey/CloudStack UI, check for shared templates using acc2 user account. The template from acc1 user account should now be visible to acc2 under shared templates.
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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