c# - User Permission Mask from NetworkCredentials -


Although I am currently developing a WinForms application on my SharePoint server, I want to work on any computer on the domain I intend to finish the program. I am using WSS web services to get all the information used from SharePoint.

I have written some code that will log all the permissions with the logical or mask, the SharePoint permission mask will check that I am having trouble returning the SharePoint mask for the current user, I would like that the user should be able to access Windows authentication It was my immediate idea so that we could log in correctly through the medium.

  Network credentials credentails = Credential cache. Default network credentials; Var userInfo = userGroupService.GetUserInfo (credentails.UserName);   

However, I am able to return the permission archive for the entire Sharepoint site with the DefaultNetworkCredentials (as with the bellow snippet), the properties are empty string, so I can not use it to get the user name.

  Permission Service. Credentials = Credential Cache. Default network credentials; PermissionService.Url = "http: //localhost/mySite/_vti_bin/Permissions.asmx"; // Web service request works XmlNode node = permissionService.GetPermissionCollection (site name, "web"); // But I need to identify the current user from this archive   

I've read that Windows certification is one that I want to save, but as I develop on the server I am sharingpoint & amp; ; IIS is running, I can not see it due to immediate issue.

Is this current user a better way to get the mask?

If the current user will always be in the same way as the user who is currently logged on to the PC < / P>

  var UserInfo = userGroupService.GetUserInfo (Environment.UserDomainName + @ "\" + Environmental Username);   

or to get permissions for the currently logged in user

  XmlNode currentUserPermission = userGroupService.GetRolesAndPermissionsForCurrentUser ();    

Comments