Do the webservices run with different permissions for different users?

Aug 18, 2010 at 1:15 PM

Marc and community!

I have been using the SPServices library in a development environment for some time and boy does it work a treat. I have had a lot of success doing some cool things with it. Today, it seems that something strange is at work. Marc knows that my hands are somewhat tied in how I have to develop, but here is the issue. I have created a .wsp solution in Visual Studio that works fine on my development box. When we deploy it to a test network, it works fine for the Admin who deploys it. Everyone else has an issue hence my question about permissions on the web services. An example is that I used the code to try to get items from a list. The site is a subsite in a site collection. The code works fine for the admin, but not for anyone else. They receive the SoapServerException message stating the Guid should contain 32 digits. I thought at first that I would just try to put in the guid of the list, but then I wondered why I would have to do that because this solution will be deployed as a subsite to many different site collections. And the code works fine for the Admin user. So why would this code not work for anyone else?!

$("#mainbody").html(waitmsg).SPServices({
operation: "GetListItems",
async: false,
listName: "Articles",
//lines omitted for brevity
completfunc: function(xData, Status) {
alert(xData.responseText);
}
});

The responseText shows correct data for the Admin, but everyone else receives the SoapServerException error. 

 

Coordinator
Aug 18, 2010 at 1:54 PM

Hey man! I haven't talked to you in ages- hope all is well!

The web services are going to run under the current user's credentials/permissions, so the users will all need to have access to the Articles list. It sounds as if you've got a permissions issue where only the admin's are seeing it because they're admins and have access to everything. Do you have the NT_Authority or the members/visitors group added as read only to that list?

Mike

Aug 18, 2010 at 3:56 PM
Edited Aug 18, 2010 at 3:58 PM

Mike, It's All Good (Sort Of!) Yes, the users have access to the list and they also are in a group with full control! If I use the GUID, it works, but only on that one subsite and that definition is used on many sites. The issue being that because it is a solution, the .aspx page is on the 12 hive so I could not use the guid method. It just seems strange that the Admin who deployed the site can access it with just the listname, but everyone else requires a guid! Consider me baffled, flummoxed, and befuddled!!!

Do you think I could get a different guid if I use the GetLists method to return the guid and would it return the correct guid for each subsite??

Coordinator
Aug 18, 2010 at 4:15 PM

You could try that. So you've confirmed that with GUID, the rest of the users can access without a problem?

That seems like an interesting hiccup... not sure I have an answer on that one!

You could use GetLists to get all of the GUIDs, assuming they're all within the same collection; if you're trying to scope outside of a single collection that may be the issue.

Aug 18, 2010 at 4:34 PM

I have confirmed that the guid would get it to work if it were a single solution that was only used in one subsite. We have many site collections with many sites and each site could have this site as a subsite. The main code is on the default.aspx page which is on the 12 hive. If I run the code to get the list guids I am hoping it will pull back the guid for the list as it exists in the subsite the user is on. I think it will work, but testing it will take some time.

Coordinator
Aug 18, 2010 at 4:43 PM
Are you specifying the WebURL? I think that the issue is with the context, not the permissions. That error about the GUID will occur if the list doesn't exist in the context you have specified, or the current Web if you haven't specified it. By providing the GUID, you don't need the WebURL -- SharePoint will find the list wherever it is based on the GUID. M.
Aug 18, 2010 at 5:13 PM

Actually, I was NOT doing that as I did not see that as an option. Of course it makes perfect sense to do so. I will test it and see what happens. Update to follow.

Aug 18, 2010 at 7:58 PM

Boy do I feel silly! That worked a champ! What I did was to add this line to my code above the listName

webURL: L_Menu_BaseUrl,

This is cool because that is a standard Sharepoint variable that works on every subsite! 

Genius Right?

 

Coordinator
Aug 18, 2010 at 8:29 PM

That makes sense... if the script is stored on the 12 hive it would need a relative path to the list if you don't use the GUID; didn't make that connection earlier.

L_Menu_BaseUrl is actually really useful for a lot of things as it'll always give you relative path from the hostname to the current level.