4c123cd domainlevel-get: fix various issues when running as non-admin

2 files Authored by abbra 5 years ago, Committed by cheimes 5 years ago,
    domainlevel-get: fix various issues when running as non-admin
    
    Use proper filter that is caught up by the ACI for 'permission:System:
    Read Domain Level' to allow any authenticated user to see the domain
    level.
    
    If the server doesn't have domain level set, callers in replica
    installer expect errors.NotFound but never get it.
    
    Return the right exception here and change the other caller to follow
    the same convention.
    
    Inability to retrieve ipaDomainLevel attribute due to a filter mismatch
    casues ipa-replica-install to fail if run as a replica host principal.
    
    Use DOMAIN_LEVEL_0 constant instead of 0 as used by the rest of the code.
    
    Fixes: https://pagure.io/freeipa/issue/7876
    Reviewed-By: Christian Heimes <cheimes@redhat.com>