summaryrefslogtreecommitdiff
path: root/portato/helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'portato/helper.py')
-rw-r--r--portato/helper.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/portato/helper.py b/portato/helper.py
index 537d631..40aff44 100644
--- a/portato/helper.py
+++ b/portato/helper.py
@@ -79,10 +79,17 @@ def debug(*args, **kwargs):
def am_i_root ():
"""Returns True if the current user is root, False otherwise.
@rtype: boolean"""
- if os.getuid() == 0:
- return True
- else:
- return False
+
+ from plugin import hook
+
+ @hook("am_i_root")
+ def __am_i_root():
+ if os.getuid() == 0:
+ return True
+ else:
+ return False
+
+ return __am_i_root()
def flatten (listOfLists):
"""Flattens the given list of lists.