Skip to content
Snippets Groups Projects
Commit 0f9236e3 authored by root's avatar root
Browse files

verification des droits avant envoi

parent 15c0208e
No related branches found
No related tags found
No related merge requests found
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
"""cranspasswords-server.py: Serveur pour cranspasswords""" """cranspasswords-server.py: Serveur pour cranspasswords"""
MYDIR = '/home/dstan/cranspasswords/' MYDIR = '/root/cranspasswords/'
STORE = MYDIR+'test/' STORE = MYDIR+'db/'
import glob import glob
import os import os
...@@ -43,7 +43,6 @@ KEYS = { ...@@ -43,7 +43,6 @@ KEYS = {
} }
RTC=[ RTC=[
"dandrimont",
"iffrig" "iffrig"
] ]
NOUNOUS=RTC+[ NOUNOUS=RTC+[
...@@ -69,7 +68,7 @@ ROLES = { ...@@ -69,7 +68,7 @@ ROLES = {
"ca": CA, "ca": CA,
"ca-w": CA, "ca-w": CA,
"nounous": NOUNOUS, "nounous": NOUNOUS,
"nounous-w": NOUNOUS #Or maybe RTC ? "nounous-w": RTC
} }
...@@ -121,7 +120,10 @@ def getfile(filename): ...@@ -121,7 +120,10 @@ def getfile(filename):
filepath = getpath(filename) filepath = getpath(filename)
try: try:
return json.loads(open(filepath).read()) obj = json.loads(open(filepath).read())
if not validate(obj['roles']):
return False
return obj
except IOError: except IOError:
return False return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment