Ejemplo n.º 1
0
def test_check_user_access_default():
    '''This validates that check_user_access denies by default if called w/o
    kwargs.

    '''

    # default policy is deny
    assert authdb.check_user_access() is False
Ejemplo n.º 2
0
def test_check_locked_access_to_preferences(access, target, expected):
    '''
    This checks user access.

    '''
    userid, role, action = access
    target_name, target_owner, target_visibility, target_sharedwith = target

    assert authdb.check_user_access(
        userid=userid,
        role=role,
        action=action,
        target_name=target_name,
        target_owner=target_owner,
        target_visibility=target_visibility,
        target_sharedwith=target_sharedwith) is expected