Beispiel #1
0
 def test_isAuthor(self):
     db.isAuthor(1, 'riz')
     assert True
Beispiel #2
0
def unShareNote(id):
    if db.isAuthor(id, getUser()):
        db.updateShare(id, 0)
        return {'ack': 1}
    else:
        return {'ack': 0, 'msg': 'You do not have permission update this note'}
Beispiel #3
0
def deleteNote(id):
    if db.isAuthor(id, getUser()):
        db.deleteNote(id)
        return {'ack': 1}
    else:
        return {'ack': 0, 'msg': 'You do not have permission delete this note'}
Beispiel #4
0
def updateNote(id):
    if db.isAuthor(id, getUser()):
        db.updateNote(id, request.forms.get('time'), request.forms.get('text'))
        return {'ack': 1}
    else:
        return {'ack': 0, 'msg': 'You do not have permission update this note'}
Beispiel #5
0
 def test_isAuthor(self):
     db.isAuthor(1, "riz")
     assert True