Index: /pykota/trunk/pykota/tool.py
===================================================================
--- /pykota/trunk/pykota/tool.py (revision 2692)
+++ /pykota/trunk/pykota/tool.py (revision 2762)
@@ -220,4 +220,21 @@
                     return True
             return False
+        
+    def sanitizeNames(self, options, names) :
+        """Ensures that an user can only see the datas he is allowed to see, by modifying the list of names."""
+        if not self.config.isAdmin :
+            username = pwd.getpwuid(os.geteuid())[0]
+            if not options["list"] :
+                raise PyKotaCommandLineError, "%s : %s" % (username, _("You're not allowed to use this command."))
+            else :
+                if options["groups"] :
+                    user = self.storage.getUser(username)
+                    if user.Exists :
+                        return [ g.Name for g in self.storage.getUserGroups(user) ]
+                return [ username ]
+        elif not names :        
+            return ["*"]
+        else :    
+            return names
         
     def display_version_and_quit(self) :
Index: /pykota/trunk/bin/edpykota
===================================================================
--- /pykota/trunk/bin/edpykota (revision 2761)
+++ /pykota/trunk/bin/edpykota (revision 2762)
@@ -27,7 +27,5 @@
 import sys
 import os
-import pwd
-import grp
-import time
+
 from pykota.tool import PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_
 from pykota.config import PyKotaConfigError
@@ -174,17 +172,5 @@
     def main(self, names, options) :
         """Edit user or group quotas."""
-        if not self.config.isAdmin :
-            username = pwd.getpwuid(os.geteuid())[0]
-            if not options["list"] :
-                raise PyKotaCommandLineError, "%s : %s" % (username, _("You're not allowed to use this command."))
-            else :
-                names = [ username ]
-                if options["groups"] :
-                    user = self.storage.getUser(username)
-                    if user.Exists :
-                        names = [ g.Name for g in self.storage.getUserGroups(user) ]
-        elif not names :        
-            names = ["*"]
-            
+        names = self.sanitizeNames(options, names)
         suffix = (options["groups"] and "Group") or "User"        
         printernames = options["printer"].split(",")
Index: /pykota/trunk/bin/pkusers
===================================================================
--- /pykota/trunk/bin/pkusers (revision 2757)
+++ /pykota/trunk/bin/pkusers (revision 2762)
@@ -160,7 +160,5 @@
     def main(self, names, options) :
         """Manage users or groups."""
-        if not self.config.isAdmin :
-            raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command."))
-            
+        names = self.sanitizeNames(options, names)
         suffix = (options["groups"] and "Group") or "User"        
         
@@ -230,6 +228,4 @@
                 self.display("\r100.00%%\r        \r%s\n" % _("Done."))
             else :        
-                if not names :
-                    names = ["*"]
                 entries = getattr(self.storage, "getMatching%ss" % suffix)(",".join(names))
                 if not entries :
@@ -407,5 +403,5 @@
         elif options["remove"] and not options["ingroups"] :    
             raise PyKotaCommandLineError, _("You have to pass user groups names on the command line")
-        elif (not args) and options["add"] :
+        elif (not args) and (options["add"] or options["delete"]) :
             raise PyKotaCommandLineError, _("You have to pass user or group names on the command line")
         else :
Index: /pykota/trunk/NEWS
===================================================================
--- /pykota/trunk/NEWS (revision 2760)
+++ /pykota/trunk/NEWS (revision 2762)
@@ -23,7 +23,8 @@
        
     - 1.24alpha15 :
-    
-        - edpykota --list is now authorized to mere mortal users, but
-          restricts the list to the current user's information.
+        
+        - 'edpykota --list' and 'pkusers --list' are now authorized 
+          to mere mortal users, but the list is restricted to informations
+          about the current user.
         
         - Extended the functionnality of the 'onbackenderror' directive to
