Examples of EJBMethodPermission


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() == null? null: 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

            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);
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

     *          in case a class could not be found
     */
    public void addPossibleEjbMethodPermissions(Permissions permissions, String ejbName, String methodInterface, Class clazz) throws OpenEJBException {
        if (clazz == null) return;
        for (java.lang.reflect.Method method : clazz.getMethods()) {
            permissions.add(new EJBMethodPermission(ejbName, methodInterface, method));
        }
    }
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);
View Full Code Here

Examples of javax.security.jacc.EJBMethodPermission

     */
    public void addPossibleEjbMethodPermissions(PermissionCollection permissions, String ejbName, String methodInterface, Class clazz) throws OpenEJBException {
        if (clazz == null) return;
        for (java.lang.reflect.Method method : clazz.getMethods()) {
            String methodIface = ("LocalBean".equals(methodInterface) || "LocalBeanHome".equals(methodInterface)) ? null : methodInterface;
            permissions.add(new EJBMethodPermission(ejbName, methodIface, method));
        }
    }
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);

            if (permission != null) securityContext.acc.checkPermission(permission);

        } catch (AccessControlException e) {
            return false;
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

    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
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.