Revision 4f824e14
Added new view roboauthall
It returns bitmask of all tool permissions for a given user
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