[acl] ajout de l'acl private (test purposes)
This commit is contained in:
parent
9a9bc16bbc
commit
a82fd6def0
|
@ -15,6 +15,11 @@ def public(*args, **kwargs) -> bool:
|
||||||
"Unlimited access"
|
"Unlimited access"
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def private(*args, **kwargs) -> bool:
|
||||||
|
"Forbidden access"
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def connected(fct=public):
|
def connected(fct=public):
|
||||||
""" Decorator that checks if the user object of the request has been set
|
""" Decorator that checks if the user object of the request has been set
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -72,7 +72,10 @@ class JWTUser(BaseUser):
|
||||||
(self.payload.get('name'), self.payload.get('firstname')))
|
(self.payload.get('name'), self.payload.get('firstname')))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def identity(self) -> str:
|
def id(self) -> str:
|
||||||
|
return self.__id
|
||||||
|
|
||||||
|
|
||||||
return self.__id
|
return self.__id
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ def test_JWTUser():
|
||||||
token = '{}'
|
token = '{}'
|
||||||
payload = {}
|
payload = {}
|
||||||
user = JWTUser(uid, token, payload)
|
user = JWTUser(uid, token, payload)
|
||||||
assert user.identity == uid
|
assert user.id == uid
|
||||||
assert user.token == token
|
assert user.token == token
|
||||||
assert user.payload == payload
|
assert user.payload == payload
|
||||||
assert user.is_authenticated == True
|
assert user.is_authenticated == True
|
||||||
|
|
Loading…
Reference in New Issue