I have a sharepoint list with the folders option enabled. My goal is to save the items only inside the folders so that I could grant unique permissions on the folder rather than the item itself.
In the ItemAdding event receiver I want to check whether the user is trying to create the item inside a specific folder(in which case I'll just return from the receiver) or the user is trying to add the item in the root of the list(in which case I'll cancel the event).
I can't seem to find a way to retrieve the item's full Url. I've tried properties.AfterUl
, HTTPContext/SPContext
saved in the constructor,etc.
Any idea would be greatly appreciated.
Basically, I want a similar functionality as in this post, but for a list instead of a document library:
Many thanks, Adrian