Package javax.security.jacc

Examples of javax.security.jacc.PolicyConfiguration.addToRole()


            policy.addToExcludedPolicy(policyContext.getExcludedPermissions());

            policy.addToUncheckedPolicy(policyContext.getUncheckedPermissions());

            for (final Map.Entry<String, PermissionCollection> entry : policyContext.getRolePermissions().entrySet()) {
                policy.addToRole(entry.getKey(), entry.getValue());
            }

            policy.commit();
        } catch (final ClassNotFoundException e) {
            throw new OpenEJBException("PolicyConfigurationFactory class not found", e);
View Full Code Here


            policy.addToExcludedPolicy(policyContext.getExcludedPermissions());

            policy.addToUncheckedPolicy(policyContext.getUncheckedPermissions());

            for (Map.Entry<String, PermissionCollection> entry : policyContext.getRolePermissions().entrySet()) {
                policy.addToRole(entry.getKey(), entry.getValue());
            }

            policy.commit();
        } catch (ClassNotFoundException e) {
            throw new OpenEJBException("PolicyConfigurationFactory class not found", e);
View Full Code Here

                String rolename = roleRef.getRoleName();
                EJBRoleRefPermission ejbrr =
                        new EJBRoleRefPermission(eName, rolename);
                String rolelink = roleRef.getSecurityRoleLink().getName();

                pc.addToRole(rolelink, ejbrr);

                if (_logger.isLoggable(Level.FINE)) {
                    _logger.fine("JACC: Converting role-ref -> " + roleRef.toString() +
                            " to permission with name(" + ejbrr.getName() +
                            ") and actions (" + ejbrr.getActions() +
View Full Code Here

                Iterator roleIt = rolePermissionsTable.entrySet().iterator();

                while (roleIt.hasNext()) {
                    Map.Entry entry = (Map.Entry)roleIt.next();
                    pc.addToRole((String) entry.getKey(),
                            (Permissions) entry.getValue());
                }
            }
        }
    }
View Full Code Here

            policy.addToExcludedPolicy(policyContext.getExcludedPermissions());

            policy.addToUncheckedPolicy(policyContext.getUncheckedPermissions());

            for (Map.Entry<String, PermissionCollection> entry : policyContext.getRolePermissions().entrySet()) {
                policy.addToRole(entry.getKey(), entry.getValue());
            }

            policy.commit();
        } catch (ClassNotFoundException e) {
            throw new OpenEJBException("PolicyConfigurationFactory class not found", e);
View Full Code Here

                Map.Entry roleEntry = (Map.Entry) roleIterator.next();
                String roleName = (String) roleEntry.getKey();
                PermissionCollection rolePermissions = (PermissionCollection) roleEntry.getValue();
                for (Enumeration permissions = rolePermissions.elements(); permissions.hasMoreElements();) {
                    Permission permission = (Permission) permissions.nextElement();
                    policyConfiguration.addToRole(roleName, permission);

                }
            }

            GeronimoPolicyConfigurationFactory roleMapperFactory = GeronimoPolicyConfigurationFactory.getSingleton();
View Full Code Here

      sysPolicy.refresh();
      assertTrue("methodX allowed", sysPolicy.implies(null, methodX) == true);

      pc.delete();
      pc = pcf.getPolicyConfiguration("context-a", false);
      pc.addToRole("callerX", someEJB);
      pc.commit();
      sysPolicy.refresh();
      SimplePrincipal[] callers = {new SimplePrincipal("callerX")};
      ProtectionDomain pd = new ProtectionDomain(null, null, null, callers);
      assertTrue("methodX allowed", sysPolicy.implies(pd, methodX) == true);
View Full Code Here

   public void testOpenConfigurations() throws Exception
   {
      PolicyConfigurationFactory pcf = PolicyConfigurationFactory.getPolicyConfigurationFactory();
      PolicyConfiguration pc = pcf.getPolicyConfiguration("context-a", false);
      EJBMethodPermission someEJB = new EJBMethodPermission("someEJB", null);
      pc.addToRole("callerX", someEJB);
      Policy sysPolicy = Policy.getPolicy();

      pc = pcf.getPolicyConfiguration("context-a", true);
      pc.addToUncheckedPolicy(someEJB);
      sysPolicy.refresh();
View Full Code Here

   public void testSubjectDoAs() throws Exception
   {
      PolicyConfigurationFactory pcf = PolicyConfigurationFactory.getPolicyConfigurationFactory();
      PolicyConfiguration pc = pcf.getPolicyConfiguration("context-a", true);
      EJBMethodPermission someEJB = new EJBMethodPermission("someEJB", null);
      pc.addToRole("callerX", someEJB);
      pc.commit();

      log.debug("EJBMethodPermission.CS: "+EJBMethodPermission.class.getProtectionDomain());
      final EJBMethodPermission methodX = new EJBMethodPermission("someEJB", "methodX");
      final Subject caller = new Subject();
View Full Code Here

                String rolename = roleRef.getRoleName();
                EJBRoleRefPermission ejbrr =
                        new EJBRoleRefPermission(eName, rolename);
                String rolelink = roleRef.getSecurityRoleLink().getName();

                pc.addToRole(rolelink, ejbrr);

                if (_logger.isLoggable(Level.FINE)) {
                    _logger.fine("JACC: Converting role-ref -> " + roleRef.toString() +
                            " to permission with name(" + ejbrr.getName() +
                            ") and actions (" + ejbrr.getActions() +
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.