The IPA.user_status_widget has been modified to show/hide the link for
activating/deactivating users according to the attributelevelrights.

Ticket #1625

--
Endi S. Dewata
From 9fde9b1a20a5d939ebcdbe42ade14ebc774e2245 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata <edew...@redhat.com>
Date: Tue, 16 Aug 2011 16:30:01 -0500
Subject: [PATCH] Hide activation/deactivation link from regular users.

The IPA.user_status_widget has been modified to show/hide the link for
activating/deactivating users according to the attributelevelrights.

Ticket #1625
---
 install/ui/user.js |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/install/ui/user.js b/install/ui/user.js
index 7247035dbd8e0a2e798cfbf0670f0a084a30d7a3..baca334b85d228e4c80807be5d9f95f49107e613 100644
--- a/install/ui/user.js
+++ b/install/ui/user.js
@@ -166,7 +166,11 @@ IPA.user_status_widget = function(spec) {
             name: 'status'
         }).appendTo(container);
 
-        container.append(': ');
+        that.link_span = $('<span/>', {
+            name: 'link'
+        }).appendTo(container);
+
+        that.link_span.append(': ');
 
         that.status_link = $('<a/>', {
             name: 'link',
@@ -191,7 +195,7 @@ IPA.user_status_widget = function(spec) {
 
                 return false;
             }
-        }).appendTo(container);
+        }).appendTo(that.link_span);
     };
 
     that.update = function() {
@@ -231,6 +235,13 @@ IPA.user_status_widget = function(spec) {
         message = message.replace('${action}', action_label);
 
         that.status_link.html(message);
+
+        if (that.writable) {
+            that.link_span.css('display', '');
+
+        } else {
+            that.link_span.css('display', 'none');
+        }
     };
 
     that.show_activation_dialog = function() {
-- 
1.7.5.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to