Package com.esri.gpt.framework.security.identity

Examples of com.esri.gpt.framework.security.identity.NotAuthorizedException


      HrRecords records = select.getQueryResult().getRecords();
      if (records.size() > 0) {
        HrRecord oldRecord = records.get(0);
        if (user.getLocalID()!=oldRecord.getOwnerId()) {
          if (!user.getIsAdministrator()) {
            throw new NotAuthorizedException("Not authorized.");
          }
        }
        if (record.getHostUrl().equals(oldRecord.getHostUrl())) {
          hostUrlChanged = false;
        }
View Full Code Here


        boolean bCheckAccess = true;
        if (bCheckAccess) {
          MetadataAcl acl = new MetadataAcl(context);
          boolean bHasAccess = acl.hasReadAccess(context.getUser(),uuid);
          if (!bHasAccess) {
            throw new NotAuthorizedException("Access denied");
          }
        }
 
        con = context.getConnectionBroker().returnConnection("").getJdbcConnection();
        String sTbl = context.getCatalogConfiguration().getResourceDataTableName();
View Full Code Here

  UIComponent component = event.getComponent();
  String sCommand = Val.chkStr((String)component.getAttributes().get("command"));
 
  // execute the command
  if (sCommand.equals("changePassword")) {
    if (!support.getSupportsPasswordChange()) throw new NotAuthorizedException("Not authorized.");
    assertLoggedIn(context);
    executeChangePassword(event,context);
  } else if (sCommand.equals("recoverPassword")) {
    if (!support.getSupportsPasswordRecovery()) throw new NotAuthorizedException("Not authorized.")
    executeRecoverPassword(event,context);
  } else if (sCommand.equals("registerUser")) {
    if (!support.getSupportsUserRegistration()) throw new NotAuthorizedException("Not authorized.")
    executeRegisterUser(event,context);
  } else if (sCommand.equals("sendFeedback")) {
    executeSendFeedback(event,context);
  } else if (sCommand.equals("updateProfile")) {
    if (!support.getSupportsUserProfileManagement()) throw new NotAuthorizedException("Not authorized.")
    assertLoggedIn(context);
    executeUpdateProfile(event,context);
  }
}
View Full Code Here

      if (sOwner.length() == 0) {
        sOwner = publisher.getKey();
      }
      if (!sOwner.equalsIgnoreCase(publisher.getKey())) {
        if (!Publisher.buildSelectablePublishers(context, true).containsKey(sOwner)) {
          throw new NotAuthorizedException("Not authorized.");
        } else {
          publisherForAction = new Publisher(context, sOwner);
        }
      }
    }
View Full Code Here

        || sAction.equalsIgnoreCase("setApproved")
        || sAction.equalsIgnoreCase("setDisapproved")
        || sAction.equalsIgnoreCase("setReviewed")
        || applyToAll;
    if (bRequiresAdmin && !publisher.getIsAdministrator()) {
      throw new NotAuthorizedException("Not authorized.");
    }
    executeAction(event, context, actionCriteria, publisher, applyToAll);
  } else if (sCommand.equals("synchronize")) {
    executeSynchronization(event, context, actionCriteria);
  } else if (sCommand.equals("cancel")) {
View Full Code Here

* @param roleKey the key associated with the required role
* @throws NotAuthorizedException if the user does not have a required role
*/
public void assertRole(String roleKey) throws NotAuthorizedException {
  if (!hasRole(roleKey)) {
    throw new NotAuthorizedException("Not authorized.");
  }
}
View Full Code Here

* @param roleSet the set of roles to check
* @throws NotAuthorizedException if the user does not have a required role
*/
public void assertRole(RoleSet roleSet) throws NotAuthorizedException {
  if (!hasRole(roleSet)) {
    throw new NotAuthorizedException("Not authorized.");
  }
}
View Full Code Here

    boolean userWasAuthenticated = false;
    if ((user != null) && user.getAuthenticationStatus().getWasAuthenticated()) {
      userWasAuthenticated = true;
    }
    if (operation.getAuthPolicy().getAuthenticationRequired() && !userWasAuthenticated) {
      throw new NotAuthorizedException("Not authorized.");
    }
   
    // determine the principals
    AsnPrincipals principals = null;
    boolean isWrite = false;
View Full Code Here

    }
    operation.getUserPart().setIPAddress(context.getRequestOptions().getIPAddress());
    AsnAuthPolicy authPolicy = operation.getAuthPolicy();
    if (authPolicy.getAuthenticationRequired()) {
      if ((user == null) || !user.getAuthenticationStatus().getWasAuthenticated()) {
        throw new NotAuthorizedException("Not authorized.");
      }
    }
    if ((user == null) || !user.getAuthenticationStatus().getWasAuthenticated()) {
      operation.getUserPart().setName(AsnConstants.ANONYMOUS_USERNAME);
      this.setWasUserEstablished(true);
View Full Code Here

    // ensure access to the document
    MetadataAcl acl = new MetadataAcl(reqContext);
    boolean bHasAccess = acl.hasReadAccess(reqContext.getUser(),id);
    if (!bHasAccess) {
      throw new NotAuthorizedException("Access denied.");
    }

    // read and return the xml
    return dao.readXml(id);
  }
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.security.identity.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.