예제 #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
파일: stream.py 프로젝트: ljxia/shiftserver
 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)