/*********************************************
* Copyright (c) 2014 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 =
"
\n" +
"- Admin
\n" +
"- Allow the user or team full access to the inventory. This includes reading, writing, deletion of the inventory and inventory sync operations.
\n" +
"- Read
\n" +
"- Only allow the user or team to view the inventory.
\n" +
"- Write
\n" +
"- 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" +
"
\n";
}
else {
scope.projectrequired = true;
scope.permissionTypeHelp =
"\n" +
"- Run
\n" +
"- 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.
\n" +
"- Check
\n" +
"- 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.
\n" +
"
\n";
}
if (reset) {
scope.permission_type = null;
}
}
}]);