Package org.glassfish.security.services.api.authorization

Examples of org.glassfish.security.services.api.authorization.AzResult


            }
            mapToAzAttrs(subjectAttrs, azSubject);
            mapToAzAttrs(resourceAttrs, azResource);
            mapToAzAttrs(actionAttrs, azAction);
           
            final AzResult azResult = authService.getAuthorizationDecision(azSubject, azResource, azAction);
            a.accessCheck.setSuccessful(azResult.getDecision() == AzResult.Decision.PERMIT);
            if (isTaggable) {
                sb.append(a.tag).append(LINE_SEP).
                   append("    ").append(formattedAccessCheck(resourceURI, a.accessCheck)).append(LINE_SEP);
            }
            result &= ( (! a.accessCheck.isFailureFinal()) || a.accessCheck.isSuccessful());
View Full Code Here


            augmentSubjectAttrs(subject, subjectAttrs);
            mapToAzAttrs(subjectAttrs, azSubject);
            mapToAzAttrs(resourceAttrs, azResource);
            mapToAzAttrs(actionAttrs, azAction);
           
            final AzResult azResult = authService.getAuthorizationDecision(azSubject, azResource, azAction);
            a.accessCheck.setSuccessful(azResult.getDecision() == AzResult.Decision.PERMIT);
            if (isTaggable) {
                sb.append(a.tag).append(LINE_SEP).
                   append("    ").append(formattedAccessCheck(resourceURI, a.accessCheck)).append(LINE_SEP);
            }
            result &= ( (! a.accessCheck.isFailureFinal()) || a.accessCheck.isSuccessful());
View Full Code Here

        // Convert parameters
        AzSubject azSubject = makeAzSubject( subject );
        AzResource azResource = makeAzResource( resource );
        AzAction azAction = makeAzAction(action);

        AzResult azResult = getAuthorizationDecision(azSubject, azResource, azAction);

        boolean result =
            AzResult.Status.OK.equals(azResult.getStatus()) &&
            AzResult.Decision.PERMIT.equals(azResult.getDecision());
        return result;
  }
View Full Code Here

        final Attributes attrs = securityContextService.getEnvironmentAttributes();
        for (String attrName : attrs.getAttributeNames()) {
            env.addAttribute(attrName, attrs.getAttributeValue(attrName), true);
        }

        AzResult result =  atzProvider.getAuthorizationDecision(
            subject, resource, action, env, attributeResolvers );

        if ( logger.isLoggable(Level.FINEST) ) {
            logger.log(Level.FINEST,
            "Authorization Service result for {0} was {1}.",
            new String[]{ subject.toString(), result.toString() } );
        }

        return result;
  }
View Full Code Here

        // Convert parameters
        AzSubject azSubject = makeAzSubject( subject );
        AzResource azResource = makeAzResource( resource );
        AzAction azAction = makeAzAction(action);

        AzResult azResult = getAuthorizationDecision(azSubject, azResource, azAction);

        boolean result =
            AzResult.Status.OK.equals(azResult.getStatus()) &&
            AzResult.Decision.PERMIT.equals(azResult.getDecision());
        return result;
  }
View Full Code Here

        final Attributes attrs = securityContextService.getEnvironmentAttributes();
        for (String attrName : attrs.getAttributeNames()) {
            env.addAttribute(attrName, attrs.getAttributeValue(attrName), true);
        }

        AzResult result =  provider.getAuthorizationDecision(
            subject, resource, action, env, attributeResolvers );

        if ( isDebug() ) {
            logger.log(DEBUG_LEVEL,
            "Authorization Service result for {0} was {1}.",
            new String[]{ subject.toString(), result.toString() } );
        }

        return result;
  }
View Full Code Here

    return isAuthorized(subject, resource, "*");
  }

    @Override
  public boolean isAuthorized(Subject subject, URI resource, String action) {
      AzResult azResult =
          getAuthorizationDecision(makeAzSubject(subject), makeAzResource(resource), makeAzAction(action));
   
      boolean result = false;
           
      if ( (AzResult.Decision.PERMIT.equals(azResult.getDecision())) &&
           (AzResult.Status.OK.equals(azResult.getStatus())) )
          result = true;
     
      return result;
  }
View Full Code Here

                || isLocalPassword
                || (adminIndicator != null)
                ||(action.getAttributeValue("ACTION").equals("read")))
                ? Decision.PERMIT : Decision.DENY;
       
        AzResult rtn = new AzResultImpl(d, Status.OK, new AzObligationsImpl());
       
        return rtn;
    }
View Full Code Here

    return isAuthorized(subject, resource, "*");
  }

    @Override
  public boolean isAuthorized(Subject subject, URI resource, String action) {
      AzResult azResult =
          getAuthorizationDecision(makeAzSubject(subject), makeAzResource(resource), makeAzAction(action));
   
      boolean result = false;
           
      if ( (AzResult.Decision.PERMIT.equals(azResult.getDecision())) &&
           (AzResult.Status.OK.equals(azResult.getStatus())) )
          result = true;
     
      return result;
  }
View Full Code Here

    public AzResult getAuthorizationDecision(AzSubject subject,
            AzResource resource, AzAction action, AzEnvironment environment) {

        //TODO: get user roles from Rolemapper, and do the policy  evaluation
        //return ok for now
        AzResult rtn = new AzResultImpl(Decision.PERMIT, Status.OK, new AzObligationsImpl());
       
        return rtn;
    }
View Full Code Here

TOP

Related Classes of org.glassfish.security.services.api.authorization.AzResult

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.