Custom Table Form editing only current user

Alexander Toups asked on July 8, 2015 19:49

I want to provide a custom table together with a custom table form for users to edit a kind of profile. Unfortunately I can't fined a way to prevent a user from editing other user's data by simple changing the URL parameter.

Each user should only be able to edit records by himself (ItemCreatedBy=%CurrentUser.UserID%).

Is it possible to user a view with custom table form instead of the table?

Or any other solution?

Recent Answers


Roman Hutnyk answered on July 8, 2015 20:58

Are you passing user ID through URL?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 8, 2015 21:26

In your WHERE clause in the repeater you can add this. If you are passing in the ItemID of the custom table record as a URL parameter that's fine, you just need to add the UserID part to it.

Try this:

ItemID = {%ItemID%} AND ItemCreatedBy = CurrentUser.UserID

This will get the ItemID from the QueryString and also check to see if it's the current user who created the record.

2 votesVote for this answer Mark as a Correct answer

Alexander Toups answered on July 9, 2015 10:09

Brenden, This works fine for the repeater. But I need this in the CustomTableForm Webpart. But there is not WHERE clause field; only "Item key Name".

Thanks a lot. Alex.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 9, 2015 14:35

I think we discussed this in another post for the same question, if I remember right I state to duplicate/clone that webpart and add the property so you can perform your filter. Simplest, easiest, fastest way to go about it.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.