/* */ public int authorize(Resource resource)
/* */ {
/* 78 */ if (!(resource instanceof WebResource)) {
/* 79 */ throw new IllegalArgumentException("resource is not a WebResource");
/* */ }
/* 81 */ WebResource webResource = (WebResource)resource;
/* */
/* 84 */ Map map = resource.getMap();
/* 85 */ if (map == null) {
/* 86 */ throw new IllegalStateException("Map from the Resource is null");
/* */ }
/* */
/* 89 */ this.authorizationManager = ((AuthorizationManager)map.get("authorizationManager"));
/* 90 */ if (this.authorizationManager == null) {
/* 91 */ throw new IllegalStateException("Authorization Manager is null");
/* */ }
/* */
/* 94 */ this.request = ((HttpServletRequest)webResource.getServletRequest());
/* */
/* 96 */ this.webCS = webResource.getCodeSource();
/* 97 */ this.canonicalRequestURI = webResource.getCanonicalRequestURI();
/* */
/* 100 */ Subject callerSubject = webResource.getCallerSubject();
/* */
/* 102 */ String roleName = (String)map.get("roleName");
/* 103 */ Principal principal = (Principal)map.get("hasRole.Principal");
/* 104 */ Set roles = (Set)map.get("principal.roles");
/* 105 */ String servletName = (String)map.get("servletName");