1
vote
5answers
287 views

How do I get SPUser Object?

I'm unable to get SPUsers/user. As an example I have here a User (Approver): <User ID=\"31\" Sid=\"\" Name=\"Approver\" LoginName=\"i:0#.w|domain\\approver\" Email=\"approver@domain.se\" ...
1
vote
1answer
119 views

Check user read access to a particular list item

I need to check if a user has read level access to a particular list Item. What would be the best approach 1) listItem.DoesUserHavePermissions(currentUser, SPBasePermissions.ViewListItems); //here ...
1
vote
1answer
574 views

SPFieldUserValue User is null

I have a list in which I can also view the version of each item. Suppose I have an item ItemX which has been modified by UserX, I then delete UserX and try to view the version item of ItemX which had ...
2
votes
1answer
166 views

Force create SPUser for disabled AD account

I am trying to get SharePoint to create an SPUser for a disabled active directory account. The reason for this is that I am archiving items across site collections. As the items are copied I am ...
2
votes
4answers
3k views

Error in Web.EnsureUser(user) :- User Not Found

Hey Friends I am trying to develop a web part in that I am fetching the user name. But doing this I am getting the error that User cannot be found. But the main thing is that in the line where I ...
1
vote
2answers
2k views

Trying to get user's manager: Getting SPServiceContext with SiteSubscriptionId of {00000000-0000-0000-0000-000000000000}

I am trying to get a user's manager with this code: SPSecurity.RunWithElevatedPriviliges(delegate { SPSite site = new SPSite(SPContext.Current.Site.Url); SPServiceContext context = ...
0
votes
1answer
178 views

How can I return user-values as a SPUser (Hyperlink) in a visual webpart in C#?

I'm developing a visual webpart (TreeView). If I click on a node (folder), it gives me the credentials of the folder. Now, the values are all appearing in a label. How can I return the users and ...
5
votes
3answers
3k views

What is the best way to determine if CurrentUser is System Account?

Traditionally I use: if (web.CurrentUser.Name == "System Account") Is there a possibility the System Account Name could be something other then "System Account". Is there a more reliable way to ...