javax.security.jacc.PolicyConfiguration Java Examples
The following examples show how to use
javax.security.jacc.PolicyConfiguration.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AuthorizationPreInitializer.java From piranha with BSD 3-Clause "New" or "Revised" License | 6 votes |
public void setPermissions(ServletContext servletContext, AuthorizationService authorizationService) throws ServletException { // Add permissions to the policy configuration, which is the repository that the policy (authorization module) // uses PolicyConfiguration policyConfiguration = authorizationService.getPolicyConfiguration(); try { List<Permission> unchecked = getOptionalAttribute(servletContext, UNCHECKED_PERMISSIONS); if (unchecked != null) { for (Permission permission : unchecked) { policyConfiguration.addToUncheckedPolicy(permission); } } List<Entry<String, Permission>> perRole = getOptionalAttribute(servletContext, PERROLE_PERMISSIONS); if (perRole != null) { for (Entry<String, Permission> perRoleEntry : perRole) { policyConfiguration.addToRole(perRoleEntry.getKey(), perRoleEntry.getValue()); } } // TODO: Move commit moment to after all ServletContainerInitializer, Filters and Servlets have initialized policyConfiguration.commit(); } catch (PolicyContextException e) { throw new IllegalStateException(e); } }
Example #2
Source File: AuthorizationPreInitializer.java From piranha with BSD 3-Clause "New" or "Revised" License | 5 votes |
public static void addToRole(PolicyConfiguration policyConfiguration, String role, Permission permission) { try { policyConfiguration.addToRole(role, permission); } catch (PolicyContextException e) { throw new IllegalStateException(e); } }
Example #3
Source File: StandardJaccServiceImpl.java From lams with GNU General Public License v2.0 | 5 votes |
private PolicyConfiguration locatePolicyConfiguration(String contextId) { try { return PolicyConfigurationFactory .getPolicyConfigurationFactory() .getPolicyConfiguration( contextId, false ); } catch (Exception e) { throw new IntegrationException( "Unable to access JACC PolicyConfiguration" ); } }
Example #4
Source File: JBossPolicyConfigurationFactory.java From lams with GNU General Public License v2.0 | 5 votes |
public PolicyConfiguration getPolicyConfiguration(String contextID, boolean remove) throws PolicyContextException { JBossPolicyConfiguration pc = policyConfigMap.get(contextID); if( pc == null ) { StateMachine sm = (StateMachine) configStateMachine.clone(); pc = new JBossPolicyConfiguration(contextID, policy, sm); policyConfigMap.put(contextID, pc); } pc.initPolicyConfiguration(remove); return pc; }
Example #5
Source File: JBossPolicyConfiguration.java From lams with GNU General Public License v2.0 | 5 votes |
public void linkConfiguration(PolicyConfiguration link) throws PolicyContextException { if (PicketBoxLogger.LOGGER.isTraceEnabled()) { PicketBoxLogger.LOGGER.traceLinkConfiguration(link.getContextID()); } validateState("linkConfiguration"); policy.linkConfiguration(contextID, link); }
Example #6
Source File: BasicJaccProvider.java From tomee with Apache License 2.0 | 5 votes |
public PolicyConfiguration getPolicyConfiguration(final String contextID, final boolean remove) throws PolicyContextException { BasicPolicyConfiguration configuration = configurations.get(contextID); if (configuration == null) { configuration = createPolicyConfiguration(contextID); configurations.put(contextID, configuration); } else { configuration.open(remove); } return configuration; }
Example #7
Source File: JaccProvider.java From tomee with Apache License 2.0 | 4 votes |
public PolicyConfiguration getPolicyConfiguration(final String contextID, final boolean remove) throws PolicyContextException { return get().getPolicyConfiguration(contextID, remove); }
Example #8
Source File: BasicJaccProvider.java From tomee with Apache License 2.0 | 4 votes |
public boolean inService(final String contextID) throws PolicyContextException { final PolicyConfiguration configuration = getPolicyConfiguration(contextID, false); return configuration.inService(); }
Example #9
Source File: BasicPolicyConfiguration.java From tomee with Apache License 2.0 | 4 votes |
public void linkConfiguration(final PolicyConfiguration link) throws PolicyContextException { if (state != OPEN) { throw new UnsupportedOperationException("Not in an open state"); } }
Example #10
Source File: JaccProvider.java From tomee with Apache License 2.0 | votes |
public abstract PolicyConfiguration getPolicyConfiguration(String contextID, boolean remove) throws PolicyContextException;