"You do not have access to order xxx" when using GetOrder()
Moderator: Phil Barton
-
- Posts: 89
- Joined: Wed Nov 16, 2011 11:51 am
Re: "You do not have access to order xxx" when using GetOrde
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.
Re: "You do not have access to order xxx" when using GetOrde
How do I determine the default profile for the user I'm authenticating with?
Re: "You do not have access to order xxx" when using GetOrde
Ok, I've determined how to get a list of users that use the default profile:
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?
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
Thoughts?
-
- Posts: 89
- Joined: Wed Nov 16, 2011 11:51 am
Re: "You do not have access to order xxx" when using GetOrde
To find the default profile for a given user, you can use the below query:
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.
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'
Re: "You do not have access to order xxx" when using GetOrde
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.
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.
-
- Posts: 89
- Joined: Wed Nov 16, 2011 11:51 am
Re: "You do not have access to order xxx" when using GetOrde
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?
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.
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);
Re: "You do not have access to order xxx" when using GetOrde
Yes, I am talking about the example you provided:
In this example, I've changed the NetworkCredential to "JoJo".
I would expect "Jojo" to be returned with the following query:
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.
Code: Select all
NetworkCredential credential = new NetworkCredential("Jojo", "MyPassword", SoftPro.ClientModel.Constants.ServerDomain);
_server = new SelectServer(null, new Uri(http://localhost:8080/), credential);
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'
Re: "You do not have access to order xxx" when using GetOrde
Confirmed. "Jojo" returns 0 records.
Re: "You do not have access to order xxx" when using GetOrde
There must be another way that authentication and template mapping is happening. Can you check how that may be done?
-
- Posts: 89
- Joined: Wed Nov 16, 2011 11:51 am
Re: "You do not have access to order xxx" when using GetOrde
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.