Package com.liferay.portal.auth

Examples of com.liferay.portal.auth.PrincipalException


  public String getUserId() throws PrincipalException {
    String name = PrincipalThreadLocal.getName();

    if (name == null) {
      throw new PrincipalException();
    }

    PrincipalFinder principalFinder = null;

    try {
      principalFinder = (PrincipalFinder)InstancePool.get(
        PropsUtil.get(PropsUtil.PRINCIPAL_FINDER));

      name = principalFinder.toLiferay(name);
    }
    catch (Exception e) {
    }

    if (Validator.isNull(name)) {
      throw new PrincipalException("Principal cannot be null");
    }

    return name;
  }
View Full Code Here


    User user = UserUtil.findByPrimaryKey(userId);

    if (!getUserId().equals(userId) &&
      !hasAdministrator(user.getCompanyId())) {

      throw new PrincipalException();
    }

    return AddressLocalManagerUtil.addAddress(
      userId, className, classPK, description, street1, street2, city,
      state, zip, country, phone, fax, cell);
View Full Code Here

  public void deleteAddress(String addressId)
    throws PortalException, SystemException {

    if (!hasWrite(addressId)) {
      throw new PrincipalException();
    }

    AddressLocalManagerUtil.deleteAddress(addressId);
  }
View Full Code Here

      String street2, String city, String state, String zip,
      String country, String phone, String fax, String cell)
    throws PortalException, SystemException {

    if (!hasWrite(addressId)) {
      throw new PrincipalException();
    }

    return AddressLocalManagerUtil.updateAddress(
      addressId, description, street1, street2, city, state, zip, country,
      phone, fax, cell);
View Full Code Here

      return;
    }

    for (int i = 0; i < addressIds.length; i++) {
      if (!hasWrite(addressIds[i])) {
        throw new PrincipalException();
      }
    }

    Map priorities = CollectionFactory.getHashMap();
View Full Code Here

    throws PortalException, SystemException {

    Company company = CompanyUtil.findByPrimaryKey(companyId);

    if (!company.isStrangers() && !hasAdministrator(companyId)) {
      throw new PrincipalException();
    }

    return UserLocalManagerUtil.addUser(
      companyId, autoUserId, userId, autoPassword, password1, password2,
      passwordReset, firstName, middleName, lastName, nickName, male,
View Full Code Here

      }

      return new KeyValuePair(userId, password);
    }
    else {
      throw new PrincipalException();
    }
  }
View Full Code Here

  public void deleteUser(String userId)
    throws PortalException, SystemException {

    if (!hasAdmin(userId)) {
      throw new PrincipalException();
    }

    if (getUserId().equals(userId)) {
      throw new RequiredUserException();
    }
View Full Code Here

  public int notifyNewUsers() throws PortalException, SystemException {
    String companyId = getUser().getCompanyId();

    if (!hasAdministrator(companyId)) {
      throw new PrincipalException();
    }

    UserConfig userConfig = AdminConfigManagerUtil.getUserConfig(companyId);

    EmailConfig registrationEmail = userConfig.getRegistrationEmail();
View Full Code Here

    userId = userId.trim().toLowerCase();

    User user = UserUtil.findByPrimaryKey(userId);

    if (!hasAdministrator(user.getCompanyId())) {
      throw new PrincipalException();
    }

    if (active == false && getUserId().equals(userId)) {
      throw new RequiredUserException();
    }
View Full Code Here

TOP

Related Classes of com.liferay.portal.auth.PrincipalException

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.