summaryrefslogtreecommitdiff
path: root/rtsadmin/ui_root.py
diff options
context:
space:
mode:
authorJerome Martin <jxm@risingtidesystems.com>2011-05-11 16:18:32 +0200
committerJerome Martin <jxm@risingtidesystems.com>2011-05-11 16:29:57 +0200
commit947874bdaeeb5430b2d31fb6f734f339cd23a1b5 (patch)
tree5a5320aaef076c659f4348a9278fb0bbb4ed2137 /rtsadmin/ui_root.py
parent063b214dd87b3fd89ff820a42b173ee961a14a24 (diff)
downloadtargetcli-947874bdaeeb5430b2d31fb6f734f339cd23a1b5.tar.gz
Disable privileged commands if user is not root.
Diffstat (limited to 'rtsadmin/ui_root.py')
-rw-r--r--rtsadmin/ui_root.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rtsadmin/ui_root.py b/rtsadmin/ui_root.py
index 40b1df9..530c266 100644
--- a/rtsadmin/ui_root.py
+++ b/rtsadmin/ui_root.py
@@ -26,10 +26,11 @@ class UIRoot(UINode):
'''
The rtsadmin hierarchy root node.
'''
- def __init__(self):
+ def __init__(self, as_root=False):
self.loaded = False
UINode.__init__(self)
self.name = '/'
+ self.as_root = as_root
def refresh(self):
'''
@@ -44,7 +45,7 @@ class UIRoot(UINode):
self.log.info("Using %s fabric module." \
% fabric_module.name)
self.add_child(UIFabricModule(fabric_module))
- else:
+ elif self.as_root:
try:
for step in fabric_module.load(yield_steps=True):
(action, taken, desc) = step