Examples of EJBMethodPermission


Examples of javax.security.jacc.EJBMethodPermission

public class JACCPreDeleteEventListener implements PreDeleteEventListener, Initializable, JACCSecurityListener {
  private String contextID;

  public boolean onPreDelete(PreDeleteEvent event) {

    EJBMethodPermission deletePermission = new EJBMethodPermission(
        event.getPersister().getEntityName(),
        HibernatePermission.DELETE,
        null,
        null
    );
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

public class JACCPreInsertEventListener implements PreInsertEventListener, Initializable, JACCSecurityListener {
  private String contextID;

  public boolean onPreInsert(PreInsertEvent event) {

    EJBMethodPermission insertPermission = new EJBMethodPermission(
        event.getPersister().getEntityName(),
        HibernatePermission.INSERT,
        null,
        null
    );
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

    StringTokenizer tok = new StringTokenizer( action, "," );

    while ( tok.hasMoreTokens() ) {
      String methodName = tok.nextToken().trim();
      EJBMethodPermission permission = new EJBMethodPermission(
          entityName,
          methodName,
          null, // interfaces
          null // arguments
        );
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

        // special handling of stateful session bean getEJBObject due how the stateful session handles acquire the
        // proxy by sending an invocation to the ejb container.
        if (ejbComponentDescription instanceof SessionBeanComponentDescription) {
            SessionBeanComponentDescription session = SessionBeanComponentDescription.class.cast(ejbComponentDescription);
            if (session.isStateful()) {
                EJBMethodPermission p = new EJBMethodPermission(ejbComponentDescription.getEJBName(), "getEJBObject", "Home", null);
                ejbJaccConfig.addPermit(p);
            }
        }
    }
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

        }

        // check if any security metadata was defined for the method.
        if (ejbMethodSecurityMetaData != null) {
            final MethodInterfaceType interfaceType = this.getMethodInterfaceType(ejbViewConfiguration.getMethodIntf());
            final EJBMethodPermission permission = new EJBMethodPermission(description.getEJBName(), methodIdentifier.getName(), interfaceType.name(), methodIdentifier.getParameterTypes());

            if (ejbMethodSecurityMetaData.isPermitAll()) {
                ejbJaccConfig.addPermit(permission);
            }
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

            InterfaceType type = deploymentInfo.getInterfaceType(method.getDeclaringClass());

            String name = (type == null) ? null : type.getSpecName();

            Permission permission = new EJBMethodPermission(ejbName, name, method);

            AccessControlContext accessContext = ContextManager.getCurrentContext();

            if (permission != null) accessContext.checkPermission(permission);
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

            InterfaceType type = deploymentInfo.getInterfaceType(method.getDeclaringClass());

            String name = (type == null) ? null : type.getSpecName();

            Permission permission = new EJBMethodPermission(ejbName, name, method);

            AccessControlContext accessContext = ContextManager.getCurrentContext();

            if (permission != null) accessContext.checkPermission(permission);
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

                    } else {
                        methodParams = null;
                    }

                    // create the permission object
                    EJBMethodPermission permission = new EJBMethodPermission(ejbName, methodName, methodIntf, methodParams);
                    notAssigned = cullPermissions(notAssigned, permission);

                    // if this is unchecked, mark it as unchecked; otherwise assign the roles
                    if (unchecked) {
                        uncheckedPermissions.add(permission);
                    } else {
                        for (String roleName : roleNames) {
                            Permissions permissions = (Permissions) rolePermissions.get(roleName);
                            if (permissions == null) {
                                permissions = new Permissions();
                                rolePermissions.put(roleName, permissions);
                            }
                            permissions.add(permission);
                        }
                    }
                }

            }

            /**
             * JACC v1.0 section 3.1.5.2
             */
            ExcludeList excludeList = assemblyDescriptor.getExcludeList();
            if (excludeList != null) {
                for (Method method : excludeList.getMethod()) {
                    if (!ejbName.equals(method.getEjbName())) {
                        continue;
                    }

                    // method name
                    String methodName = method.getMethodName();
                    // method interface
                    String methodIntf = method.getMethodIntf().toString();

                    // method parameters
                    String[] methodParams;
                    if (method.getMethodParams() != null) {
                        List<String> paramList = method.getMethodParams().getMethodParam();
                        methodParams = paramList.toArray(new String[paramList.size()]);
                    } else {
                        methodParams = null;
                    }

                    // create the permission object
                    EJBMethodPermission permission = new EJBMethodPermission(ejbName, methodName, methodIntf, methodParams);

                    excludedPermissions.add(permission);
                    notAssigned = cullPermissions(notAssigned, permission);
                }
            }
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

        }

        try {
            Class clazz = Class.forName(interfaceClass, false, classLoader);
            for (java.lang.reflect.Method method : clazz.getMethods()) {
                permissions.add(new EJBMethodPermission(ejbName, methodInterface, method));
            }
        } catch (ClassNotFoundException e) {
            throw new DeploymentException(e);
        }
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

  public JACCPreInsertEventListener(String contextId) {
    this.contextId = contextId;
  }

  public boolean onPreInsert(PreInsertEvent event) {
    final EJBMethodPermission insertPermission = new EJBMethodPermission(
        event.getPersister().getEntityName(),
        HibernatePermission.INSERT,
        null,
        null
    );
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.