"You do not have access to order xxx" when using GetOrder()

Discussions related to order tracking development with the ProForm module.

Moderator: Phil Barton

john.morton
Posts: 89
Joined: Wed Nov 16, 2011 11:51 am

Re: "You do not have access to order xxx" when using GetOrde

Post by john.morton »

Yes, it should succeed. But currently the only way to, "...use this profile to manipulate the order" is to have that profile be the default profile for the user you're authenticating to the API with.
mrisen
Posts: 98
Joined: Wed Jul 25, 2012 7:01 pm

Re: "You do not have access to order xxx" when using GetOrde

Post by mrisen »

How do I determine the default profile for the user I'm authenticating with?
mrisen
Posts: 98
Joined: Wed Jul 25, 2012 7:01 pm

Re: "You do not have access to order xxx" when using GetOrde

Post by mrisen »

Ok, I've determined how to get a list of users that use the default profile:

Code: Select all

SELECT t.UserName, p.Name, p.ID
FROM dbo.Trustee t
INNER JOIN dbo.TrusteeToProfileMToN ttp ON t.ID = ttp.TrusteeID
INNER JOIN dbo.Profile p ON ttp.ProfileID = p.ID
WHERE p.ID LIKE --DEFAULT PROFILE GUID--
ORDER BY UserName
However, as I mentioned before, the account the service runs under is not in this list. This is working in our Production environment which is running under the same account and it is not listed in the user table either.

Thoughts?
john.morton
Posts: 89
Joined: Wed Nov 16, 2011 11:51 am

Re: "You do not have access to order xxx" when using GetOrde

Post by john.morton »

To find the default profile for a given user, you can use the below query:

Code: Select all

select t.UserName, pp.ProfilePath
  from ProfilePath pp
 inner join TrusteeToProfileMToN tp
    on tp.ProfileID  = pp.ProfileID
 inner join Trustee t 
    on t.ID = tp.TrusteeID
 where tp.IsDefault = 1
   and t.UserName = 'YourUserNameHere'
This is the profile that will be used by the API when you authenticate with that given user... i.e. when you get the SelectServer object.
mrisen
Posts: 98
Joined: Wed Jul 25, 2012 7:01 pm

Re: "You do not have access to order xxx" when using GetOrde

Post by mrisen »

I am still turning up nothing.

Is the UserName in the Trustee table (always) the same as the Windows Domain username or is there a mapping somewhere that connects SoftPro username to Domain username?

As far as I can tell, nothing should be working as we don't have the account the the APIs run under in SoftPro. But... it WAS working and IS working still in Production so I'm clearly missing something.
john.morton
Posts: 89
Joined: Wed Nov 16, 2011 11:51 am

Re: "You do not have access to order xxx" when using GetOrde

Post by john.morton »

It depends on whether or not it's a "custom" login or not. A custom login username can be whatever you want it to be. A non-custom login is tied to the Windows Domain account name.

When you talk about the "account the APIs run under", you ARE talking about the accounts that actually authenticate in the code correct? Like the following example?

Code: Select all

NetworkCredential credential = new NetworkCredential("Admin", "MyPassword", SoftPro.ClientModel.Constants.ServerDomain);
_server = new SelectServer(null, new Uri(http://localhost:8080/), credential);
In the previous example, the only profile that matters, in regards to what orders you'll be able to open, is what default profile (based on that query I posted early) the "admin" user has.
mrisen
Posts: 98
Joined: Wed Jul 25, 2012 7:01 pm

Re: "You do not have access to order xxx" when using GetOrde

Post by mrisen »

Yes, I am talking about the example you provided:

Code: Select all

NetworkCredential credential = new NetworkCredential("Jojo", "MyPassword", SoftPro.ClientModel.Constants.ServerDomain);
_server = new SelectServer(null, new Uri(http://localhost:8080/), credential);
In this example, I've changed the NetworkCredential to "JoJo".
I would expect "Jojo" to be returned with the following query:

Code: Select all

select t.UserName, pp.ProfilePath
  from ProfilePath pp
 inner join TrusteeToProfileMToN tp
    on tp.ProfileID  = pp.ProfileID
 inner join Trustee t 
    on t.ID = tp.TrusteeID
 where tp.IsDefault = 1
   and t.UserName = 'Jojo'
But nothing is returned. Yet, I think in our Production environment that this is working fine. I will double check on this, however, just to make sure.
mrisen
Posts: 98
Joined: Wed Jul 25, 2012 7:01 pm

Re: "You do not have access to order xxx" when using GetOrde

Post by mrisen »

Confirmed. "Jojo" returns 0 records.
mrisen
Posts: 98
Joined: Wed Jul 25, 2012 7:01 pm

Re: "You do not have access to order xxx" when using GetOrde

Post by mrisen »

There must be another way that authentication and template mapping is happening. Can you check how that may be done?
john.morton
Posts: 89
Joined: Wed Nov 16, 2011 11:51 am

Re: "You do not have access to order xxx" when using GetOrde

Post by john.morton »

To make sure that the user you're using is correctly associated with the profile that you need it to be associated with, please log into the application using the normal application icon. My guess is that you either have no profiles associated with that user, or you just don't have a default profile selected. In either case, you'll want to make sure you're using the profile that you're expecting it be using.
Post Reply