20: def authorized?(request)
21: msg = "#{request.authenticated? ? "authenticated" : "unauthenticated"} client #{request} access to #{request.call}"
22:
23: if request.authenticated?
24: if authconfig.exists?
25: if authconfig.allowed?(request)
26: Puppet.debug "Allowing #{msg}"
27: return true
28: else
29: Puppet.notice "Denying #{msg}"
30: return false
31: end
32: else
33: if Puppet.run_mode.master?
34: Puppet.debug "Allowing #{msg}"
35: return true
36: else
37: Puppet.notice "Denying #{msg}"
38: return false
39: end
40: end
41: else
42: if request.handler == "puppetca"
43: Puppet.notice "Allowing #{msg}"
44: else
45: Puppet.notice "Denying #{msg}"
46: return false
47: end
48: end
49: end