(self, obj_str, obj_type)
Generate defaults grants for one section
Generate defaults grants for one section
Generate defaults grants for one section
def gen_defs(self, obj_str, obj_type):
        "Generate defaults grants for one section"

        if obj_type == "FUNCTION":
            defgrants = "execute"
        elif obj_type == "DATABASE":
            defgrants = "connect, temp"
        elif obj_type in ("LANGUAGE", "TYPE", "DOMAIN"):
            defgrants = "usage"
        else:
            return

        defrole = 'public'

        obj_str = obj_str.strip().replace('\n', '\n    ')
        print "GRANT %s ON %s\n  TO %s;" % (defgrants, obj_str, defrole)
def gen_defs ( self , obj_str , obj_type ) : if obj_type == "FUNCTION" : defgrants = "execute" elif obj_type == "DATABASE" : defgrants = "connect, temp" elif obj_type in ( "LANGUAGE" , "TYPE" , "DOMAIN" ) : defgrants = "usage" else : return defrole = 'public' obj_str = obj_str . strip ( ) . replace ( '\n' , '\n    ' ) print "GRANT %s ON %s\n  TO %s;" % ( defgrants , obj_str , defrole )