# File lib/puppet/network/authorization.rb, line 22
22:         def authorized?(request)
23:             msg = "%s client %s access to %s" %
24:                 [request.authenticated? ? "authenticated" : "unauthenticated",
25:                     request, request.call]
26: 
27:             if request.authenticated?
28:                 if authconfig.exists?
29:                     if authconfig.allowed?(request)
30:                         Puppet.debug "Allowing " + msg
31:                         return true
32:                     else
33:                         Puppet.notice "Denying " + msg
34:                         return false
35:                     end
36:                 else
37:                     # This is a hack way of seeing if we're a config master.
38:                     if Puppet[:name] == "puppetmasterd"
39:                         Puppet.debug "Allowing " + msg
40:                         return true
41:                     else
42:                         Puppet.notice "Denying " + msg
43:                         return false
44:                     end
45:                 end
46:             else
47:                 if request.handler == "puppetca"
48:                     Puppet.notice "Allowing " + msg
49:                 else
50:                     Puppet.notice "Denying " + msg
51:                     return false
52:                 end
53:             end
54:         end