Package org.gatein.management.api.exceptions

Examples of org.gatein.management.api.exceptions.NotAuthorizedException


public abstract class SecureOperationHandler implements OperationHandler {
    @Override
    public final void execute(OperationContext operationContext, ResultHandler resultHandler) throws ResourceNotFoundException, OperationException {
        // Secure all operations for MOP Management extension to /platform/administrators group.
        if (!operationContext.getExternalContext().isUserInRole("administrators")) {
            throw new NotAuthorizedException(operationContext.getUser(), operationContext.getOperationName());
        }

        doExecute(operationContext, resultHandler);
    }
View Full Code Here


      }

      // Make sure user is authorized to invoke operation
      if (!isAuthorized(operationContext.getExternalContext(), managedRole, owner.managedRole))
      {
         throw new NotAuthorizedException(operationContext.getUser(), operationContext.getOperationName());
      }

      invokeBefore(operationContext);
      try
      {
View Full Code Here

    private Utils() {
    }

    public static void verifyAccess(Site site, OperationContext context) throws NotAuthorizedException {
        if (!hasPermission(site.getAccessPermission())) {
            throw new NotAuthorizedException(context.getUser(), context.getOperationName());
        }
    }
View Full Code Here

        }
    }

    public static void verifyAccess(Page page, OperationContext context) throws NotAuthorizedException {
        if (!hasPermission(page.getAccessPermission())) {
            throw new NotAuthorizedException(context.getUser(), context.getOperationName());
        }
    }
View Full Code Here

TOP

Related Classes of org.gatein.management.api.exceptions.NotAuthorizedException

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.