mirror of
https://github.com/ansible/awx.git
synced 2026-07-09 15:28:05 -02:30
AC-697 Dynamic help on Permissions page based on Permission Type. Uses a help collapse. Added ngBind support to help collapse, allowing the controller to set a scope variable to an html string. Added a Permissions.js helper to share setting help text and other defaults whenever permission type changes.
This commit is contained in:
48
awx/ui/static/js/helpers/Permissions.js
Normal file
48
awx/ui/static/js/helpers/Permissions.js
Normal file
@@ -0,0 +1,48 @@
|
||||
/*********************************************
|
||||
* Copyright (c) 2013 AnsibleWorks, Inc.
|
||||
*
|
||||
* Permissions.js
|
||||
*
|
||||
* Functions shared amongst Permission related controllers
|
||||
*
|
||||
*/
|
||||
angular.module('PermissionsHelper', [])
|
||||
|
||||
// Handle category change event
|
||||
.factory('PermissionCategoryChange', [ function() {
|
||||
return function(params) {
|
||||
var scope = params.scope;
|
||||
var reset = params.reset;
|
||||
|
||||
if (scope.category == 'Inventory') {
|
||||
scope.projectrequired = false;
|
||||
scope.permissionTypeHelp =
|
||||
"<dl>\n" +
|
||||
"<dt>Admin</dt>\n" +
|
||||
"<dd>Allow the user or team full access to the inventory. This includes reading, writing, deletion of the inventory and inventory sync operations.</dd>\n" +
|
||||
"<dt>Read</dt>\n" +
|
||||
"<dd>Only allow the user or team to view the inventory.</dd>\n" +
|
||||
"<dt>Write</dt>\n" +
|
||||
"<dd>Allow the user or team to modify hosts and groups contained in the inventory, add new hosts and groups, and perform inventory sync operations.\n" +
|
||||
"</dl>\n";
|
||||
}
|
||||
else {
|
||||
scope.projectrequired = true;
|
||||
scope.permissionTypeHelp =
|
||||
"<dl>\n" +
|
||||
"<dt>Run</dt>\n" +
|
||||
"<dd>Allow the user or team to perform a live deployment of the project against the inventory. In Run mode modules will " +
|
||||
"be executed, and changes to the inventory will occur.</dd>\n" +
|
||||
"<dt>Check</dt>\n" +
|
||||
"<dd>Only allow the user or team to deploy the project against the inventory as a dry-run operation. In Check mode, module operations " +
|
||||
"will only be simulated. No changes will occur.</dd>\n" +
|
||||
"</dl>\n";
|
||||
}
|
||||
|
||||
if (reset) {
|
||||
scope.permission_type = null;
|
||||
}
|
||||
|
||||
}
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user