Genady Vaisman
Genady Vaisman
March 09, 2011
Stay in the know
Get helpful videos

Hello,

Do you need to hide specific columns based on user identity and column values? Smart List Pro will help you achieve that in no time, no code required.

This convenient control has been around since the old good MOSS days, but was never given enough attention..

So i would like to explain what it is good for and how you can use it in your site.

SPSecurityTrimmedControl will basically hide all its content from users that won't meet a given security definition.

Unlike the previous solutions (style.display='none'...), the content will be hidden on the server side!

For Example: recently i was asked to show the top ribbon only to users with Manage rights.

What i did, was:

Open the site's Master Page in SharePoint Designer

Find a div with id= s4-ribbonrow, its content is actually the top ribbon

Wrap this div with a SPSecurityTrimmedControl, like this:

 

spsecuritytrimmedcontrol

Useful attributes of the control:

  • PermissionContext - against which user permissions will be tested

(possible values: CurrentSite, CurrentList, CurrentFolder, CurrentItem or RootSite)

  • PemissionMode - does the user have to meet all role definitions or just one of them

(possible values: All or Any)

  • PermissionsString - what permissions does the user need to see the content - can enter some values separated by comma

(possible values are from the enumeration SPBasePermissions:

EmptyMask,ViewListItems,AddListItems,EditListItems,DeleteListItems,ApproveItems,OpenItems,ViewVersions,

DeleteVersions,CancelCheckout,ManagePersonalViews,ManageLists,ViewFormPages,Open,ViewPages,

AddAndCustomizePages, ApplyThemeAndBorder,ApplyStyleSheets,ViewUsageData,CreateSSCSite,

ManageSubwebs,CreateGroups, ManagePermissions,BrowseDirectories,BrowseUserInfo,AddDelPrivateWebParts,

UpdatePersonalWebParts,ManageWeb, UseClientIntegration,UseRemoteAPIs,ManageAlerts,CreateAlerts,

EditMyUserInfo,EnumeratePermissions,FullMask)

  • AuthenticationRestrictions - allows to differ between authenticated and anonymous users

(possible values: AllUsers, AuthenticatedUsersOnly, AnonymousUsersOnly)

save, check-in, publish and there you go!

Loading...

Add your comment

Comments are not meant for support. If you experiencing an issue, please open a support request.
Development
As a skilled SharePoint developer, I have spent years customizing forms and workflows. My goal is to speed up business processes and improve user experiences. The ability to customize SharePoint to fit individual organizational demands has always been a challenging and rewarding endeavor.  Today, I'll discuss how to create custom SharePoint...
Development
The best way to show off your product is of course letting your potential customers try it out. In our case, Ultimate Forms is a Microsoft SharePoint application, so it needs SharePoint to run. Of course, potential customers can easily install it and we even provide an installation wizard that will completely automate and streamline the...
Development
Will Cooper | February 21, 2025
Dynamic Forms are an essential part of SharePoint solutions. Dynamic Forms change in appearance and functionality according to rules defined in the form. This is the opposite of out-of-the-box static SharePoint forms which don't change in appearance or functionality. Learning how to how to use rules in Ultimate Forms Form Designer is the key to...
Build powerful business applications in SharePoint using only your browser.
100% No-Code Solution
It’s never been easier to create, innovate, and share. All you need is your web browser!
Cost-Effective
Address business process pain points immediately. Save time and money.
Fantastic Support Team
In addition to our responsive support team, a wide variety of resources, documentations, tutorials, blogs and webinars is available to you
Microsoft partner logo
© 2005-2025 Infowise Solutions Ltd. All rights reserved.
Privacy | Cookie Policy | Accessibility | Cloud SLA