def getUserInfo(HOSTNAME, APPNAME, username): url = HOSTNAME + "/user/getById" textmod = {"username": username, "app_name": APPNAME} return get(url, textmod)
def assignPerm(HOSTNAME, APPNAME, permitName, rid): url = HOSTNAME + "/role/assignPerm" textmod = {u"app_name": APPNAME, u"pname": permitName, u"rid": rid} return get(url, textmod)
def listPermById(HOSTNAME, APPNAME, uid): url = HOSTNAME + "/perms/listAllByUid" textmod = {"uid": uid, "app_name": APPNAME} return get(url, textmod)
def listTree(HOSTNAME, rid, parse=None): url = HOSTNAME + "/orgTree/listTree" textmod = {"rid": rid} if parse: textmod["parse"] = 1 return get(url, textmod)
def getOrg(HOSTNAME, APPNAME, code): url = HOSTNAME + "/orgTree/getNodeInfo" textmod = {"app_name": APPNAME, "code": code} return get(url, textmod)
def listPermit(HOSTNAME, APPNAME): url = HOSTNAME + "/perms/listAll" textmod = {"app_name": APPNAME, "qs": "", "pageNum": 0, "pageSize": 1000} print APPNAME return get(url, textmod)
def deletePermit(HOSTNAME, permitId): url = HOSTNAME + "/perms/delete" textmod = {"ids": permitId} return get(url, textmod)