summaryrefslogtreecommitdiffstats
path: root/install/ui/user.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-05-23 11:52:20 +0200
committerPetr Vobornik <pvoborni@redhat.com>2012-06-04 10:45:08 +0200
commitbf9234dbd1911a6e720470844ad053053144cc45 (patch)
treea2596f9971c062b332fdf7dbfcac215cc4182008 /install/ui/user.js
parentbf0c6ff697182840f3e4fca0ee92e2a293296754 (diff)
downloadfreeipa-bf9234dbd1911a6e720470844ad053053144cc45.tar.gz
freeipa-bf9234dbd1911a6e720470844ad053053144cc45.tar.xz
freeipa-bf9234dbd1911a6e720470844ad053053144cc45.zip
Enable reset password action according to attribute perrmission
This patch creates state_evaluator which creates permission states for defined attribute. The state format is: attributeName_permissionChar. This evaluator is used for user_password attribute and it control enabling/disabling of related action in user account action panel. https://fedorahosted.org/freeipa/ticket/2318
Diffstat (limited to 'install/ui/user.js')
-rw-r--r--install/ui/user.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/install/ui/user.js b/install/ui/user.js
index 04fac6bc0..c9835c9c0 100644
--- a/install/ui/user.js
+++ b/install/ui/user.js
@@ -239,7 +239,8 @@ IPA.user.entity = function(spec) {
factory: IPA.enable_state_evaluator,
field: 'nsaccountlock',
invert_value: true
- }
+ },
+ IPA.user.reset_password_acl_evaluator
],
summary_conditions: [
IPA.enabled_summary_cond(),
@@ -613,7 +614,7 @@ IPA.user.reset_password_action = function(spec) {
spec = spec || {};
spec.name = spec.name || 'reset_password';
spec.label = spec.label || IPA.messages.password.reset_password;
- //TODO: add enable condition based on ACL
+ spec.enable_cond = spec.enable_cond || ['userpassword_w'];
var that = IPA.action(spec);
@@ -629,4 +630,13 @@ IPA.user.reset_password_action = function(spec) {
return that;
};
+IPA.user.reset_password_acl_evaluator = function(spec) {
+
+ spec.name = spec.name || 'reset_password_acl_evaluator';
+ spec.attribute = spec.attribute || 'userpassword';
+
+ var that = IPA.acl_state_evaluator(spec);
+ return that;
+};
+
IPA.register('user', IPA.user.entity); \ No newline at end of file