mirror of
https://github.com/ansible/awx.git
synced 2026-01-29 07:14:43 -03:30
47 lines
1.8 KiB
JavaScript
47 lines
1.8 KiB
JavaScript
/*************************************************
|
|
* Copyright (c) 2015 Ansible, Inc.
|
|
*
|
|
* All Rights Reserved
|
|
*************************************************/
|
|
|
|
/**
|
|
* @ngdoc function
|
|
* @name helpers.function:Users
|
|
* @description
|
|
* UserHelper
|
|
* Routines shared amongst the user controllers
|
|
*
|
|
*/
|
|
|
|
|
|
export default
|
|
angular.module('UserHelper', ['UserFormDefinition'])
|
|
.factory('ResetForm', ['UserForm',
|
|
function (UserForm) {
|
|
return function () {
|
|
// Restore form to default conditions. Run before applying LDAP configuration.
|
|
// LDAP may manage some or all of these fields in which case the user cannot
|
|
// make changes to their values in AWX.
|
|
|
|
UserForm.fields.first_name.readonly = false;
|
|
UserForm.fields.first_name.editRequired = true;
|
|
UserForm.fields.last_name.readonly = false;
|
|
UserForm.fields.last_name.editRequired = true;
|
|
UserForm.fields.email.readonly = false;
|
|
UserForm.fields.email.editRequired = true;
|
|
UserForm.fields.organization.awRequiredWhen = {
|
|
reqExpression: "orgrequired",
|
|
init: true
|
|
};
|
|
UserForm.fields.organization.readonly = false;
|
|
UserForm.fields.username.awRequiredWhen = {
|
|
reqExpression: "not_ldap_user",
|
|
init: true
|
|
};
|
|
UserForm.fields.username.readonly = false;
|
|
UserForm.fields.password.editRequired = false;
|
|
UserForm.fields.password.addRrequired = true;
|
|
};
|
|
}
|
|
]);
|