summaryrefslogtreecommitdiff
path: root/src/authn.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/authn.py')
-rwxr-xr-xsrc/authn.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/authn.py b/src/authn.py
index 8227e2c..d57e382 100755
--- a/src/authn.py
+++ b/src/authn.py
@@ -17,6 +17,7 @@ class Authz:
def write_p(self):
return 'w' in self._perms
+
class User:
def __init__(self, username, pw, authz):
self._username = username
@@ -37,18 +38,19 @@ class User:
def read_perms(self):
acc = []
- for k,v in self._authz.items():
+ for k, v in self._authz.items():
if v.read_p():
acc.append(k)
return acc
def write_perms(self):
acc = []
- for k,v in self._authz.items():
+ for k, v in self._authz.items():
if v.write_p():
acc.append(k)
return acc
+
class UserDB:
def __init__(self, yamlfile):
self._users = {}
@@ -105,5 +107,6 @@ def self_test():
assert(len(wp) == 1)
assert('sunet.se' in wp)
+
if __name__ == '__main__':
self_test()