I have a Silverlight control in MOSS (Sharepoint 2007) which I want to conditionally enable based upon the user roles set in Sharepoint. I found that I may add a Web reference to the UserGroups service with
http://<server-url>/_vti_bin/usergroup.asmx
according to this article on MSDN. To my chagrin, although I can easily add a Web reference, I have not been able to find what assembly I must reference. Does anyone know what assembly this, and whether I may going the correct route? Thanks always.
Edit
Silverlight is client side so apparently I need a way to get the SPUser and SPGroup information from the server. WSS services dont’ seem to have a useful method. I’m now trying to make a page in Sharepoint Designer and use it as a quasi RESTful service. Is this folly? I would expect Sharepoint to come with this particular service.
Edit
Since SharePoint 2007 doesn’t allow Silverlight Controls to access server side API elements like SPUser, I came up with a solution where I pass flag values in the InitParameters. It is posted below.
I found that MOSS (a.k.a. SharePoint 2007) has no mechanism for accessing SPUser permission the client. Hence SilverLight controls have no direct means to obtain this information. My solution was to modify the WebPart hosting the SilverLight control to include a property, which would pass that information to the SilverLight control as one of the InitParams.
Currently there are many WebParts for hosting a SilverLight control available on the Web. Here are a few examples.
CodePlex
http://silverlightwebpart.codeplex.com/
Kirk Evans Blog
http://blogs.msdn.com/b/kaevans/archive/2008/10/08/hosting-silverlight-in-a-sharepoint-webpart.aspx
There are noticable similarities with my WebPart and the one in this article.
http://blogs.msdn.com/b/andreww/archive/2009/03/12/silverlight-web-part-in-sharepoint.aspx
What I decided to do is make the WebPart itself configurable
Next in the SilverLight control I use the Initparameters
The Dictionary in the SilverLight UserControl exists in the App.xaml.cs as seen here
What can I say? It works.