[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"
|
||||
return True
|
||||
|
||||
def private(*args, **kwargs) -> bool:
|
||||
"Forbidden access"
|
||||
return False
|
||||
|
||||
|
||||
def connected(fct=public):
|
||||
""" 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')))
|
||||
|
||||
@property
|
||||
def identity(self) -> str:
|
||||
def id(self) -> str:
|
||||
return self.__id
|
||||
|
||||
|
||||
return self.__id
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ def test_JWTUser():
|
|||
token = '{}'
|
||||
payload = {}
|
||||
user = JWTUser(uid, token, payload)
|
||||
assert user.identity == uid
|
||||
assert user.id == uid
|
||||
assert user.token == token
|
||||
assert user.payload == payload
|
||||
assert user.is_authenticated == True
|
||||
|
|
Loading…
Reference in New Issue