Project

General

Profile

Revision 4f824e14

ID4f824e1451c88118e95a78928917fa9c9df09120
Parent cc7646f9
Child 13fd9e7e

Added by Thomas Mullins almost 11 years ago

Added new view roboauthall

It returns bitmask of all tool permissions for a given user

View differences:

crm/robocrm/views.py
19 19
  else :
20 20
    return HttpResponse("0")
21 21

  
22
def roboauthall(request, rfid_tag):
23
  r = RoboUser.objects.filter(rfid=rfid_tag)
24
  if r.count() > 0:
25
    us = r[0]
26
  else:
27
    return HttpResponse("0")
28
  auth = 0
29
  for mach in us.machines.all():
30
    auth |= 1 << int(mach.id)
31
  return HttpResponse(str(auth))
32

  
22 33
def add_card_event(request):
23 34
  if request.method != 'POST':
24 35
    raise Http404

Also available in: Unified diff