Skip to content

Commit

Permalink
Policy.setPolicy(null)
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzi80 committed Mar 9, 2022
1 parent 6f98425 commit 5efca6c
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ public void contextInitialized(ServletContextEvent event) {

logger.info( "init AppId: " + getServletContextId(servletContext) );

// https://github.com/eclipse-ee4j/exousia/issues/16
// https://github.com/piranhacloud/piranha/blob/f841972fb1839b0239e2fa150b23e4a4fc6f6d15/extension/exousia/src/main/java/cloud/piranha/extension/exousia/AuthorizationPreInitializer.java
// No need for the previous policy (likely the Java SE "JavaPolicy") to be consulted.
Policy.setPolicy(null);

AuthorizationService.setThreadContextId(servletContext);

// Initialize the AuthorizationService, which is a front-end for Jakarta Authorization.
Expand Down Expand Up @@ -102,6 +97,10 @@ public void contextDestroyed(ServletContextEvent event) {
String appId = getServletContextId(event.getServletContext());
logger.info( "contextDestroyed "+appId );
AuthorizationService.deletePolicy(appId); // if ( appId != null && appId.length() > 0 )
// https://github.com/eclipse-ee4j/exousia/issues/16
// https://github.com/piranhacloud/piranha/blob/f841972fb1839b0239e2fa150b23e4a4fc6f6d15/extension/exousia/src/main/java/cloud/piranha/extension/exousia/AuthorizationPreInitializer.java
// No need for the previous policy (likely the Java SE "JavaPolicy") to be consulted.
Policy.setPolicy(null);
localServletRequest.remove(); // it's ok?
}

Expand Down

0 comments on commit 5efca6c

Please sign in to comment.