doPrincipalAttributesAllowServiceAccess determines access right of a service:
boolean doPrincipalAttributesAllowServiceAccess(String principal, Map<String, Object> attributes)
I think it's helpful to know not only the principal but also the service information such as service id, especially in groovy script.