سؤال

I really need an expert advice. I have been created classic Survey on Sharepoint Foundation 2013 and set all needed permission. And this is great for my HR department except one thing. They want me to hide "Show a graphical summary of responses" and "show all responses" links for end user, just Admin (HR department) can see those links. After hours of googling I found (perfect solution for me) SPSecurityTrimmedControl. But I dont know where to place this, because when I open my survey in designer I do not see any div or tr tag. So, my question is....where I need to insert this and how? This is picture of my overview.aspx of my survey. enter image description here

هل كانت مفيدة؟

المحلول

The SPSecurityTrimmedControl is nothing more than a container that works by stopping its Render event when the specified permissions aren't meet. It doesn't enforce security of links - it just make them not rendered: anyone who knows the url can still input it manually. This also means that in order to use it, you need to wrap the content that you want it to remove. This is a problem in your case: from what I can understand from your question and screenshot, the content you want to secure is "dynamically" generated by a web part, and as such you cannot wrap it in a SPSecurityTrimmedControl instance - you would have to wrap all the web part, but that would remove all the content, not just the two links you need too.

That said, I was wondering. Any chance you may just work your way by re-configuring the permissions on the survey? I remember there is an option to make it so users can only read their own answer, and this post seem to confirm it. I don't remember if this will also remove the links, but may provide a starting point anyway. Otherwise, I fear you will have to resort to a Javascript/JQuery based solution to remove them on client side - but remember, you want to remove the permissions too, or the users could just write the url manually.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top