示例#1
0
文件: user.py 项目: ljxia/shiftserver
 def messages(self, userName):
     loggedInUser = helper.getLoggedInUser()
     messageStream = user.messageStream(user.idForName(userName))
     if stream.canRead(messageStream, loggedInUser["_id"]):
         return data(event.joinData(event.eventsForStream(messageStream)))
     else:
         return error("You do not have permission to view this user's messages.", PermissionError)
示例#2
0
 def read(self, id):
     loggedInUser = helper.getLoggedInUser()
     if stream.canRead(id, loggedInUser["_id"]):
         return data(stream.read(id))
     else:
         return error("Operation not permitted. You don't have permission to view this stream.", PermissionError)