getUser() public method

public getUser ( gov.va.medora.mdo.dao.AbstractConnection cxn, string userId ) : User
cxn gov.va.medora.mdo.dao.AbstractConnection
userId string
return User
Exemplo n.º 1
0
        // This does an administrative visit in order to get the true user's data
        internal User getVisitorData(string userSitecode, string DUZ, string appPwd)
        {
            Site site = mySession.SiteTable.getSite(userSitecode);
            AbstractCredentials credentials = getAdministrativeCredentials(site);
            credentials.AuthenticationToken = userSitecode + '_' + credentials.LocalUid;
            credentials.SecurityPhrase = appPwd;

            string context = MdwsConstants.MDWS_CONTEXT;
            if (mySession.DefaultVisitMethod == MdwsConstants.NON_BSE_CREDENTIALS)
            {
                context = MdwsConstants.CPRS_CONTEXT;
            }

            // Here we do NOT set mySession.PrimaryPermission.  This context is being set
            // solely for the Admin user to get the true user's credentials.  mySession.PrimaryPermission
            // is for the true user.
            AbstractPermission permission = new MenuOption(context);
            permission.IsPrimary = true;

            User u = doTheVisit(userSitecode, credentials, permission);

            UserApi userApi = new UserApi();
            User trueUser = userApi.getUser(myCxn, DUZ);
            myCxn.disconnect();
            return trueUser;
        }
Exemplo n.º 2
0
 internal UserTO getUser(AbstractConnection cxn, string DUZ)
 {
     UserTO result = new UserTO();
     if (DUZ == "")
     {
         result.fault = new FaultTO("Missing DUZ");
     }
     if (result.fault != null)
     {
         return result;
     }
     try
     {
         UserApi api = new UserApi();
         User u = api.getUser(cxn, DUZ);
         result = new UserTO(u);
     }
     catch (Exception e)
     {
         result.fault = new FaultTO(e.Message);
     }
     return result;
 }