2

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

3

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.

  • Hi, thank you for your explanation, I inderstand now. Yes, I was set permission for user that ther could see only their answer instead of all answer but my department is not statisfied with only that solution. But you know what, I don't care any more, because this level od Sharepoint is not in my domain to do this. Really really thank you :) – Dada Sep 12 '16 at 6:07
  • My pleasure, if you need something else fell free to ask another question. I wonder what made your department think that using actual permissions isn't a good solution: removing just the links fells like an attempt at "security by obscurity" and that is never good. – BlueSoul Sep 12 '16 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.