Examples of AbstractWebAuthorizationHelper


Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

         Map<String, Object> contextMap = new HashMap<String, Object>();
         contextMap.put(ResourceKeys.RESOURCE_PERM_CHECK, Boolean.TRUE);
         contextMap.put(ResourceKeys.POLICY_REGISTRATION, policyRegistration);
         contextMap.put("securityConstraints", securityConstraints);

         AbstractWebAuthorizationHelper helper = null;
         try
         {
            helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
         }
         catch (Exception e)
         {
            log.error("Exception in obtaining helper", e);
            return false;
         }

         helper.setPolicyRegistration(policyRegistration);
         helper.setEnableAudit(this.enableAudit);

         //WebAuthorizationHelper helper = new WebAuthorizationHelper(sc, this.enableAudit);
         ok = helper.checkResourcePermission(contextMap, request, response, caller, PolicyContext.getContextID(),
               requestURI(request));
      }
      boolean finalDecision = baseDecision && ok;
      if (trace)
         log.trace("hasResourcePerm:RealmBase says:" + baseDecision + "::Authz framework says:" + ok + ":final=" + finalDecision);
View Full Code Here

Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

      if (baseDecision && !ignoreJBossAuthorization)
      {
         SecurityContext sc = SecurityAssociationActions.getSecurityContext();

         AbstractWebAuthorizationHelper helper = null;
         try
         {
            helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
         }
         catch (Exception e)
         {
            log.error("Error obtaining helper", e);
         }
         helper.setPolicyRegistration(getPolicyRegistration());
         helper.setEnableAudit(enableAudit);
         Subject callerSubject = SecurityAssociationActions.getSubject();
         if (callerSubject == null)
         {
            //During hasResourcePermission check, catalina calls hasRole. But we have not established
            // a subject yet in the security context. So we will get the subject from the cached principal
View Full Code Here

Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

         Map<String, Object> map = new HashMap<String, Object>();
         map.put("securityConstraints", constraints);
         map.put(ResourceKeys.USERDATA_PERM_CHECK, Boolean.TRUE);

         SecurityContext sc = SecurityAssociationActions.getSecurityContext();
         AbstractWebAuthorizationHelper helper = null;
         try
         {
            helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
         }
         catch (Exception e)
         {
            log.error("Error obtaining helper", e);
         }
         helper.setPolicyRegistration(getPolicyRegistration());
         helper.setEnableAudit(enableAudit);
         Subject callerSubject = SecurityAssociationActions.getSubject();
         //JBAS-6419:CallerSubject has no bearing on the user data permission check
         if(callerSubject == null)
            callerSubject = new Subject();

         ok = helper.hasUserDataPermission(map, request, response, PolicyContext.getContextID(),
               callerSubject);
      }

      return ok;
   }
View Full Code Here

Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

                caller = getSubjectFromRequestPrincipal(request.getPrincipal());
            Map<String, Object> contextMap = new HashMap<String, Object>();
            contextMap.put(ResourceKeys.RESOURCE_PERM_CHECK, Boolean.TRUE);
            contextMap.put("securityConstraints", constraints);

            AbstractWebAuthorizationHelper helper = null;
            try {
                helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
            } catch (Exception e) {
                WebLogger.WEB_SECURITY_LOGGER.noAuthorizationHelper(e);
                return false;
            }

            authzDecision = helper.checkResourcePermission(contextMap, request, response, caller, PolicyContext.getContextID(),
                    requestURI(request), getPrincipalRoles(request));
        }
        boolean finalDecision = baseDecision && authzDecision;
        WebLogger.WEB_SECURITY_LOGGER.tracef("hasResourcePermission:RealmBase says:" + baseDecision + "::Authz framework says:" + authzDecision
                + ":final=" + finalDecision);
View Full Code Here

Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

                    }
                }
            }

            SecurityContext sc = SecurityActions.getSecurityContext();
            AbstractWebAuthorizationHelper helper = null;
            try {
                helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
            } catch (Exception e) {
                WebLogger.WEB_SECURITY_LOGGER.noAuthorizationHelper(e);
            }
            Subject callerSubject = sc.getUtil().getSubject();
            if (callerSubject == null) {
                // During hasResourcePermission check, Catalina calls hasRole. But we have not established
                // a subject yet in the security context. So we will get the subject from the cached principal
                callerSubject = getSubjectFromRequestPrincipal(principal);
            }

            authzDecision = helper.hasRole(roleName, principal, servletName, getPrincipalRoles(principal),
                    PolicyContext.getContextID(), callerSubject, getPrincipalRoles(request));
        }
        boolean finalDecision = baseDecision && authzDecision;
        WebLogger.WEB_SECURITY_LOGGER.tracef("hasRole:RealmBase says:" + baseDecision + "::Authz framework says:" + authzDecision + ":final="
                + finalDecision);
View Full Code Here

Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

            Map<String, Object> map = new HashMap<String, Object>();
            map.put("securityConstraints", constraints);
            map.put(ResourceKeys.USERDATA_PERM_CHECK, Boolean.TRUE);

            SecurityContext sc = SecurityActions.getSecurityContext();
            AbstractWebAuthorizationHelper helper = null;
            try {
                helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
            } catch (Exception e) {
                WebLogger.WEB_SECURITY_LOGGER.noAuthorizationHelper(e);
            }

            Subject callerSubject = sc.getUtil().getSubject();
            // JBAS-6419:CallerSubject has no bearing on the user data permission check
            if (callerSubject == null)
                callerSubject = new Subject();

            ok = helper.hasUserDataPermission(map, request, response, PolicyContext.getContextID(), callerSubject,
                    getPrincipalRoles(request));
        }

        return ok;
    }
View Full Code Here

Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

         Map<String, Object> contextMap = new HashMap<String, Object>();
         contextMap.put(ResourceKeys.RESOURCE_PERM_CHECK, Boolean.TRUE);
         contextMap.put(ResourceKeys.POLICY_REGISTRATION, policyRegistration);
         contextMap.put("securityConstraints", securityConstraints);

         AbstractWebAuthorizationHelper helper = null;
         try
         {
            helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
         }
         catch (Exception e)
         {
            log.error("Exception in obtaining helper", e);
            return false;
         }

         helper.setPolicyRegistration(policyRegistration);
         helper.setEnableAudit(this.enableAudit);

         //WebAuthorizationHelper helper = new WebAuthorizationHelper(sc, this.enableAudit);
         ok = helper.checkResourcePermission(contextMap, request, response, caller, PolicyContext.getContextID(),
               requestURI(request));
      }
      if (trace)
         log.trace("hasResourcePerm:RealmBase says:" + baseDecision + "::Authz framework says:" + ok + ":final=" + ok);
      if (ok == false)
View Full Code Here

Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

      if (baseDecision)
      {
         SecurityContext sc = SecurityAssociationActions.getSecurityContext();

         AbstractWebAuthorizationHelper helper = null;
         try
         {
            helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
         }
         catch (Exception e)
         {
            log.error("Error obtaining helper", e);
         }
         helper.setPolicyRegistration(getPolicyRegistration());
         helper.setEnableAudit(enableAudit);
         Subject callerSubject = SecurityAssociationActions.getSubject();
         if (callerSubject == null)
         {
            //During hasResourcePermission check, catalina calls hasRole. But we have not established
            // a subject yet in the security context. So we will get the subject from the cached principal
View Full Code Here

Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

         Map<String, Object> map = new HashMap<String, Object>();
         map.put("securityConstraints", constraints);
         map.put(ResourceKeys.USERDATA_PERM_CHECK, Boolean.TRUE);

         SecurityContext sc = SecurityAssociationActions.getSecurityContext();
         AbstractWebAuthorizationHelper helper = null;
         try
         {
            helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
         }
         catch (Exception e)
         {
            log.error("Error obtaining helper", e);
         }
         helper.setPolicyRegistration(getPolicyRegistration());
         helper.setEnableAudit(enableAudit);
         Subject callerSubject = SecurityAssociationActions.getSubject();
         //JBAS-6419:CallerSubject has no bearing on the user data permission check
         if(callerSubject == null)
            callerSubject = new Subject();

         ok = helper.hasUserDataPermission(map, request, response, PolicyContext.getContextID(),
               callerSubject);
      }

      return ok;
   }
View Full Code Here

Examples of org.jboss.security.javaee.AbstractWebAuthorizationHelper

                caller = getSubjectFromRequestPrincipal(request.getPrincipal());
            Map<String, Object> contextMap = new HashMap<String, Object>();
            contextMap.put(ResourceKeys.RESOURCE_PERM_CHECK, Boolean.TRUE);
            contextMap.put("securityConstraints", constraints);

            AbstractWebAuthorizationHelper helper = null;
            try {
                helper = SecurityHelperFactory.getWebAuthorizationHelper(sc);
            } catch (Exception e) {
                log.errorf("Exception in obtaining helper", e);
                return false;
            }

            authzDecision = helper.checkResourcePermission(contextMap, request, response, caller, PolicyContext.getContextID(),
                    requestURI(request), getPrincipalRoles(request));
        }
        boolean finalDecision = baseDecision && authzDecision;
        log.tracef("hasResourcePermission:RealmBase says:" + baseDecision + "::Authz framework says:" + authzDecision
                + ":final=" + finalDecision);
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.