We use Sharepoint as a CMS for our web pages at work. I know how to create controls that can only be visible if you are logged in to SharePoint using:
<Sharepoint: SPSecurityTrimmedControl ID = "SPSecurityTrimmedControl1" Runat = "Server" PermissionsString = "AddAndCustomizePages"> <br />
<Sharepoint: CssLink ID = "CssLink1" runat = "server" />
<br /> </ Sharepoint: SPSecurityTrimmedCont
But I want to know how to make the controls visible (or something else) programmatically depending on the permissions.
I cannot use methods for Windows authentication in the form of .NET:
if (!(HttpContext.Current.User == null) && HttpContext.Current.User.Identity.IsAuthenticated){}
because we use it for anonymous users who have a different type of login.
Could you provide the code? I know this should be something like checking for SPContext.Current.FormContext.
source
share