Show
Ignore:
Timestamp:
02/27/06 23:28:01 (18 years ago)
Author:
jerome
Message:

Make pkusers --list behave like edpykota --list : allowed to normal users,
but restricted in what can be seen.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkusers

    r2757 r2762  
    160160    def main(self, names, options) : 
    161161        """Manage users or groups.""" 
    162         if not self.config.isAdmin : 
    163             raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command.")) 
    164              
     162        names = self.sanitizeNames(options, names) 
    165163        suffix = (options["groups"] and "Group") or "User"         
    166164         
     
    230228                self.display("\r100.00%%\r        \r%s\n" % _("Done.")) 
    231229            else :         
    232                 if not names : 
    233                     names = ["*"] 
    234230                entries = getattr(self.storage, "getMatching%ss" % suffix)(",".join(names)) 
    235231                if not entries : 
     
    407403        elif options["remove"] and not options["ingroups"] :     
    408404            raise PyKotaCommandLineError, _("You have to pass user groups names on the command line") 
    409         elif (not args) and options["add"] : 
     405        elif (not args) and (options["add"] or options["delete"]) : 
    410406            raise PyKotaCommandLineError, _("You have to pass user or group names on the command line") 
    411407        else :