Exemple #1
0
def is_admin(uid=None, bid=None):
    if users.is_current_user_admin():
        return True
    cur_user = users.get_current_user().user_id()
    if uid == cur_user:
        return True
    if bid:
        user_key = ndb.Key('User', cur_user)
        admins = Business.get_by_id(bid).admins
        return user_key in admins
    return False
Exemple #2
0
 def get_record(self, business_id):
     logger.info('NdbBusinessDao:: DBHIT: get_record for %s ' % business_id)
     return Business.get_by_id(long(business_id))