Changeset 1821

Show
Ignore:
Timestamp:
10/13/04 23:40:10 (20 years ago)
Author:
jalet
Message:

Now mandates that the user be a PyKota administrator to allow dangerous
command line options. --list is still allowed to mere mortals though.

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkprinters

    r1803 r1821  
    2424# 
    2525# $Log$ 
     26# Revision 1.17  2004/10/13 21:40:10  jalet 
     27# Now mandates that the user be a PyKota administrator to allow dangerous 
     28# command line options. --list is still allowed to mere mortals though. 
     29# 
    2630# Revision 1.16  2004/10/11 22:53:05  jalet 
    2731# Postponed string interpolation to help message's output method 
     
    7882# 
    7983 
     84import os 
    8085import sys 
     86import pwd 
    8187 
    8288from pykota.tool import PyKotaTool, PyKotaToolError, crashed, N_ 
     
    180186    def main(self, names, options) : 
    181187        """Manage printers.""" 
     188        if (not self.config.isAdmin) and (not options["list"]) : 
     189            raise PyKotaToolError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command.")) 
     190             
    182191        if options["list"] and not names : 
    183192            names = ["*"] 
  • pykota/trunk/NEWS

    r1814 r1821  
    2424    - 1.20alpha25 : 
    2525     
     26        - pkprinters allows --list to normal users, but require user 
     27          to be a PyKota administrator when another command line  
     28          option is used. 
     29           
    2630        - pkhint doesn't use absolute path to search for helper commands 
    2731          anymore.