def user(self, userName): """ Web page of details about the user. """ self.validate(userName) groups = GroupInfo.groupsForUser(userName).keys() requests = UserRequests.listRequests(userName).keys() allGroups = GroupInfo.listGroups() self.validate(groups) self.validate(requests) self.validate(allGroups) return self.templatepage("User", user=userName, groups=groups, allGroups=allGroups, requests=requests)
def user(self, userName): """ Web page of details about the user, and sets user priority """ self.validate(userName) groups = GroupInfo.groupsForUser(userName).keys() requests = UserRequests.listRequests(userName).keys() priority = UserManagement.getPriority(userName) allGroups = GroupInfo.listGroups() self.validate(groups) self.validate(requests) self.validate(allGroups) return self.templatepage("User", user=userName, groups=groups, allGroups=allGroups, requests=requests, priority=priority)
def getUser(self, userName = None, group = None): """ No args returns a list of all users. Group returns groups this user is in. Username returs a JSON with information about the user """ if userName != None: if not Registration.isRegistered(userName): raise cherrypy.HTTPError(404, "Cannot find user") result = {} result['groups'] = GroupInfo.groupsForUser(userName).keys() result['requests'] = UserRequests.listRequests(userName).keys() result.update(Registration.userInfo(userName)) return result elif group != None: GroupInfo.usersInGroup(group) else: return Registration.listUsers()
def getUser(self, userName=None, group=None): """ No args returns a list of all users. Group returns groups this user is in. Username returs a JSON with information about the user """ if userName != None: if not Registration.isRegistered(userName): raise cherrypy.HTTPError(404, "Cannot find user") result = {} result['groups'] = GroupInfo.groupsForUser(userName).keys() result['requests'] = UserRequests.listRequests(userName).keys() result.update(Registration.userInfo(userName)) return result elif group != None: GroupInfo.usersInGroup(group) else: return Registration.listUsers()