Examples of EJBRoleRefPermission


Examples of javax.security.jacc.EJBRoleRefPermission

            Context context = subjectContexts.get(currentSubject);

            assert context != null : "No registered context";

            context.context.checkPermission(new EJBRoleRefPermission(EJBName, role));
        } catch (AccessControlException e) {
            return false;
        }
        return true;
    }
View Full Code Here

Examples of javax.security.jacc.EJBRoleRefPermission

            Context context = subjectContexts.get(currentSubject);

            assert context != null : "No registered context";

            context.context.checkPermission(new EJBRoleRefPermission(EJBName, role));
        } catch (AccessControlException e) {
            return false;
        }
        return true;
    }
View Full Code Here

Examples of javax.security.jacc.EJBRoleRefPermission

            Context context = (Context) subjectContexts.get(currentSubject);

            assert context != null : "No registered context";

            context.context.checkPermission(new EJBRoleRefPermission(EJBName, role));
        } catch (AccessControlException e) {
            return false;
        }
        return true;
    }
View Full Code Here

Examples of javax.security.jacc.EJBRoleRefPermission

            Context context = (Context) subjectContexts.get(currentSubject);

            assert context != null : "No registered context";

            context.context.checkPermission(new EJBRoleRefPermission(EJBName, role));
        } catch (AccessControlException e) {
            return false;
        }
        return true;
    }
View Full Code Here

Examples of javax.security.jacc.EJBRoleRefPermission

      Iterator iroleref = eDescriptor.getRoleReferences().iterator();
      while(iroleref.hasNext()){
    SecurityRoleReference roleRef =
        (SecurityRoleReference) iroleref.next();
    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()+
         ")" + "mapped to role ("+rolelink+")");
    }
      }
  }
    }
View Full Code Here

Examples of javax.security.jacc.EJBRoleRefPermission

  if(_logger.isLoggable(Level.FINE)){
      _logger.entering("EJBSecurityManager", "isCallerInRole", role);

  }
  EJBRoleRefPermission ejbrr = new EJBRoleRefPermission(ejbName, role);

   SecurityContext sc;
  if (runAs != null) {
      InvocationManager im = theSwitch.getInvocationManager();
      ComponentInvocation ci = im.getCurrentInvocation();
      sc = ci.getOldSecurityContext();
  } else {
      sc = SecurityContext.getCurrent();
  }
   Set principalSet = null;
   if (sc != null) principalSet = sc.getPrincipalSet();
   ProtectionDomain prdm = getCachedProtectionDomain(principalSet,true);

        try {
            // set the policy context in the TLS.
            String oldContextId = setPolicyContext(this.contextId);
            try {

                ret = policy.implies(prdm, ejbrr);
            } catch (SecurityException se) {
                _logger.log(Level.SEVERE, "JACC: Unexpected security exception isCallerInRole", se);
                ret = false;
            } catch (Throwable t) {
                _logger.log(Level.SEVERE, "JACC: Unexpected exception isCallerInRole", t);
                ret = false;
            } finally {
                resetPolicyContext(oldContextId, this.contextId);
            }

        } catch (Throwable t) {
            _logger.log(Level.SEVERE, "JACC: Unexpected exception manipulating policy context", t);
            ret = false;
        }

   if(_logger.isLoggable(Level.FINE)){
       _logger.fine("JACC: isCallerInRole Result: " +ret + " EJBRoleRefPermission (Name) = "+ ejbrr.getName() + " (Action) = "+ ejbrr.getActions() + " (Codesource) = " + prdm.getCodeSource());
   }
 
    return ret;
    }
View Full Code Here

Examples of javax.security.jacc.EJBRoleRefPermission

        SecurityContext securityContext = threadContext.get(SecurityContext.class);

        try {
            CoreDeploymentInfo deployment = threadContext.getDeploymentInfo();

            securityContext.acc.checkPermission(new EJBRoleRefPermission(deployment.getEjbName(), role));
        } catch (AccessControlException e) {
            return false;
        }
        return true;
    }
View Full Code Here

Examples of javax.security.jacc.EJBRoleRefPermission

            if (roleLinks == null) {
                roleLinks = new Permissions();
                rolePermissions.put(roleLink, roleLinks);

            }
            roleLinks.add(new EJBRoleRefPermission(ejbName, securityRoleRef.roleName));
        }

        /**
         * EJB v2.1 section 21.3.2
         * <p/>
 
View Full Code Here

Examples of javax.security.jacc.EJBRoleRefPermission

        String EJBName = deploymentInfo.getEjbName();
        if (EJBName == null) throw new IllegalArgumentException("EJBName must not be null");
        try {
            AccessControlContext context = ContextManager.getCurrentContext();
            context.checkPermission(new EJBRoleRefPermission(EJBName, role));
        } catch (AccessControlException e) {
            return false;
        }
        return true;
    }
View Full Code Here

Examples of javax.security.jacc.EJBRoleRefPermission

        // of PolicyConfigurationFactory
        assert pc != null;
        String eName = eDescriptor.getName();
        for (RoleReference roleRef : eDescriptor.getRoleReferences()) {
            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() +
                        ")" + "mapped to role (" + rolelink + ")");
            }
        }
    }
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.