def test_encoded(): access = IdentityAccess(request_meta,identity,encoded=tree_encoded) assert access.permissions['f71cd3af5e055dbe99dfb800ec1eeec101c5435a'] assert not access.generated assert not access.changed assert access.check_access(level,type,domain,path) assert access.check_access(level,type,domain,path2) assert not access.check_access(level,type,domain,"/") assert not access.check_access(level,type,domain,path3)
def test_tree_grant(): access = IdentityAccess(request_meta,identity) access.grant_access(level,type,domain,path2,datetime.max,page=False) assert access.changed assert access.check_access(level,type,domain,path) assert access.check_access(level,type,domain,path2) assert not access.check_access(level,type,domain,"/") assert not access.check_access(level,type,domain,path3)
def test_deny(): access = IdentityAccess(request_meta,identity) access.grant_access(level,type,domain,path,datetime.max,page=True) assert access.check_access(level,type,domain,path) access.deny_access(level,type,domain,path,page=True) assert not access.check_access(level,type,domain,path)
def test_page_grant(): access = IdentityAccess(request_meta,identity) access.grant_access(level,type,domain,path,datetime.max,page=True) assert access.changed assert access.check_access(level,type,domain,path)