1

I have a solution in which a few site columns are deployed. These columns are used in a few hidden lists, and webparts showing data from these columns have logic which checks the permissions of the user. When the user lacks permission, the columns aren't displayed.

Now when a user is added, there is a notification being generated for one of those lists. The user receives an e-mail of updates on list items, but that lists the column that should not be shown! Also, when the user click on one of the items from the notification mail, the link takes him to the hidden lists, displays the item and again the things I didn't want to show.

So now I need to perform an update on my solution to make sure this doesn't happen again. I'm just not sure what I should exactly change. I noticed an SPField has a property 'Hidden' which I could set to false; but would that also keep it from rendering in item display views and notification mails? There's also the DisplayInNewForm and DisplayInEditForm properties, but I'm not sure if those are also used by the notification mail.

3 Answers 3

1

I'm not sure if the 'ShowInXXXX' properties for SPField are obeyed by email generation, but I'd start by trying them. They're simpler to use. I expect you'd have best luck with 'ShowInViewForms'.

The Hidden attribute will also work, but you also need to be aware of a second property - CanToggleHidden. If you don't set that to true, you can end up defining fields that are hidden, and you can't later unhide if you want to.

Also, I note this question is similar to another on StackOverflow: https://stackoverflow.com/questions/1120427/hide-field-in-sharepoint-alert-email

1
  • Thanks, since the other thread is marked answer I'll assume at least one of these will work. After trying them out I'll post which one works best.
    – Jasper
    Commented Jan 17, 2012 at 6:45
0

Making a column Hidden will hide it in everything but code. You could try setting it to hidden using powershell in a test environment to be sure.

-1

Make sure you apply proper security at the list level. SharePoint will honor the security no matter what link the user is clicking.

2
  • There is no security on column level as far as I know? A normal user should be able to view list items, but not all columns for those items. So a user may get an update when an item is changed, but the private columns shouldn't be in the alert. It would be even better when the alert is only sent out when a visible column (visible to a normal user that is) changes.
    – Jasper
    Commented Dec 27, 2011 at 10:33
  • Indeed, there is no column level security
    – Andy Burns
    Commented Jan 17, 2012 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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