Package org.jboss.security

Examples of org.jboss.security.AuthorizationManager


   @ManagementOperation(description = "Get the authorization manager for the specified security domain",
         params = {@ManagementParameter(name = "securityDomain", description = "The security domain name")})
   public AuthorizationManager getAuthorizationManager(String securityDomain)
   {
      initialize();
      AuthorizationManager am = null;
      try
      {
         am = this.authzMgrMap.get(securityDomain);
         if(am == null)
         {
View Full Code Here


         SecurityConstraint[] constraints, Context context) throws IOException
   {
      boolean isAuthorized = super.hasResourcePermission(request, response,
                                   constraints, context);
      log.debug("Super class has authorized="+isAuthorized);
      AuthorizationManager authzManager = null;
      try
      {
         authzManager = this.getAuthorizationManager();
      }
      catch(Exception e)
      {
         log.error("Error obtaining Authorization Manager:",e);
      }
     
      final HashMap map =  new HashMap();
      map.put("catalina.request",request);
      map.put("catalina.constraints",constraints);
      map.put("catalina.context", context);
      map.put("authorizationManager",authzManager);
      WebResource resource = new WebResource(map);
      try
      {
         int check = authzManager.authorize(resource);
         isAuthorized = (check == AuthorizationContext.PERMIT);
      }
      catch (Exception e)
      {
         isAuthorized = false;
View Full Code Here

        RunAs runAs = securityContext.getIncomingRunAs();
        if (runAs != null && runAs instanceof RunAsIdentity) {
            RunAsIdentity runAsIdentity = (RunAsIdentity) runAs;
            roleGroup = runAsIdentity.getRunAsRolesAsRoleGroup();
        } else {
            AuthorizationManager am = securityContext.getAuthorizationManager();
            SecurityContextCallbackHandler scb = new SecurityContextCallbackHandler(securityContext);

            roleGroup = am.getSubjectRoles(securityContext.getSubjectInfo().getAuthenticatedSubject(), scb);
        }

        List<Role> roles = roleGroup.getRoles();

        // TODO - Review most performant way.
View Full Code Here

        return am;
    }

    /** {@inheritDoc} */
    public AuthorizationManager getAuthorizationManager(String securityDomain) {
        AuthorizationManager am = null;
        try {
            am = authzMgrMap.get(securityDomain);
            if (am == null) {
                am = (AuthorizationManager) lookUpJNDI(securityDomain + "/authorizationMgr");
                authzMgrMap.put(securityDomain, am);
View Full Code Here

        return am;
    }

    /** {@inheritDoc} */
    public AuthorizationManager getAuthorizationManager(String securityDomain) {
        AuthorizationManager am = null;
        try {
            am = authzMgrMap.get(securityDomain);
            if (am == null) {
                am = (AuthorizationManager) lookUpJNDI(securityDomain + "/authorizationMgr");
                authzMgrMap.put(securityDomain, am);
View Full Code Here

         SecurityConstraint[] constraints, Context context) throws IOException
   {
      boolean isAuthorized = super.hasResourcePermission(request, response,
                                   constraints, context);
      log.debug("Super class has authorized="+isAuthorized);
      AuthorizationManager authzManager = null;
      try
      {
         authzManager = this.getAuthorizationManager();
      }
      catch(Exception e)
      {
         log.error("Error obtaining Authorization Manager:",e);
      }
     
      final HashMap map =  new HashMap();
      map.put("catalina.request",request);
      map.put("catalina.constraints",constraints);
      map.put("catalina.context", context);
      map.put("authorizationManager",authzManager);
      WebResource resource = new WebResource(map);
      try
      {
         int check = authzManager.authorize(resource);
         isAuthorized = (check == AuthorizationContext.PERMIT);
      }
      catch (Exception e)
      {
         isAuthorized = false;
View Full Code Here

        if (runAs != null && runAs instanceof RunAsIdentity) {
            RunAsIdentity runAsIdentity = (RunAsIdentity) runAs;
            roleGroup = runAsIdentity.getRunAsRolesAsRoleGroup();
        } else {

            AuthorizationManager am = securityContext.getAuthorizationManager();
            SecurityContextCallbackHandler scb = new SecurityContextCallbackHandler(securityContext);

            roleGroup = am.getSubjectRoles(securityContext.getSubjectInfo().getAuthenticatedSubject(), scb);
        }

        List<Role> roles = roleGroup.getRoles();

        // TODO - Review most performant way.
View Full Code Here

        return am;
    }

    /** {@inheritDoc} */
    public AuthorizationManager getAuthorizationManager(String securityDomain) {
        AuthorizationManager am = null;
        try {
            am = authzMgrMap.get(securityDomain);
            if (am == null) {
                am = (AuthorizationManager) lookUpJNDI(securityDomain + "/authorizationMgr");
                authzMgrMap.put(securityDomain, am);
View Full Code Here

   @ManagementOperation(description = "Get the authorization manager for the specified security domain",
         params = {@ManagementParameter(name = "securityDomain", description = "The security domain name")})
   public AuthorizationManager getAuthorizationManager(String securityDomain)
   {
      initialize();
      AuthorizationManager am = null;
      try
      {
         am = this.authzMgrMap.get(securityDomain);
         if(am == null)
         {
View Full Code Here

    @see java.security.acl.Group;
    @see Subject#getPrincipals()
    */
   public boolean doesUserHaveRole(Principal principal, Set<Principal> rolePrincipals)
   {
      AuthorizationManager am = SecurityUtil.getAuthorizationManager(securityDomain,
            SecurityConstants.JAAS_CONTEXT_ROOT);
      return am.doesUserHaveRole(principal, rolePrincipals);
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.AuthorizationManager

Copyright © 2018 www.massapicom. 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.