Package de.innovationgate.webgate.api

Examples of de.innovationgate.webgate.api.WGUserDetails


                session.beginTransaction();
            }

            if (master) {
                // Master login always has manager access
                getSessionStatus().setUserDetails(new WGUserDetails(WGDatabase.ACCESSLEVEL_MANAGER, WGDatabase.MASTER_USERNAME ,"(None)", null, null, null, null, null, true, true));
                return new WGUserAccess(WGDatabase.MASTER_USERNAME, WGDatabase.ACCESSLEVEL_MANAGER);
            }

            // Determine access
            WGUserDetails userDetails;
            try {
                userDetails = _db.defaultBuildUserDetails(authSession);
            }
            catch (WGBackendException e) {
                try {
                    closeSession();
                }
                catch (WGBackendException e1) {
                    WGFactory.getLogger().error(e1);
                }
                throw e;
            }
            getSessionStatus().setUserDetails(userDetails);
            if (userDetails.getAccessLevel() <= WGDatabase.ACCESSLEVEL_NOACCESS) {
                try {
                    closeSession();
                }
                catch (WGBackendException e) {
                    WGFactory.getLogger().error(e);
View Full Code Here


  }

  private Object getDatabaseUserMetaData(WGUserAccess userAccess, String name, String originalName) throws WGAPIException {
     
      // Look if we have detailed user information
      WGUserDetails userDetails = null;
      if (userAccess instanceof WGUserDetails) {
          userDetails  = (WGUserDetails) userAccess;
      }
     
      if (name.equals("username")) {
            return userAccess.getPrimaryName();
        }
      else if (name.equals("useraccess")) {
            return new Integer(userAccess.getAccessLevel());
        }
        else if (name.startsWith("userlabel_") || name.startsWith("useralias_")) {
            if (userDetails != null) {
                int sublinePos = name.indexOf("_");
                String label = originalName.substring(sublinePos + 1);
                return userDetails.getLabeledNames().get(label);
            }
            else {
                return null;
            }
        }
        else if (name.equals("useraliases")) {
            if (userDetails != null) {
                return userDetails.getAliases();
            }
            else {
                return null;
            }
        }
        else if (name.equals("userroles")) {
            if (userDetails != null) {
                return userDetails.getRoles();
            }
            else {
                return null;
            }
        }
        else if (name.equals("usergroups")) {
            if (userDetails != null) {
                return userDetails.getGroups();
            }
            else {
                return null;
            }
        }
        else if (name.equals("useremail")) {
            if (userDetails != null) {
                return userDetails.getEMailAddress();
            }
            else {
                return null;
            }
        }
View Full Code Here

TOP

Related Classes of de.innovationgate.webgate.api.WGUserDetails

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.