def delete_user(username): user = UserDao.get_user(username) if user and authentication.allow_full_user_changes(username): UserDao.delete_user(username) user = UserDao.get_user(username) if not user: assignees = assigneesHandler.get_customers(username) for assignee in assignees: assigneesHandler.delete(assignee.get('user'), assignee.get('customer')) assignees = assigneesHandler.get_customers('username') if not assignees or len(assignees) == 0: return True return False
def update_user(user): if authentication.allow_full_user_changes(user): return full_update_user(user) if authentication.allow_semi_user_changes(user): return semi_update_user(user) return False