Hot answers tagged

6

Not sure why you think your appoach is dirty. That's the right use of the SPSecurityTrimmedControl and you should not be afraid to use it that way! In fact, MSDN suggest to use it for resolving issues like yours: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.spsecuritytrimmedcontrol.aspx and even more interesting use of it here: ...


5

I think @LeopoldLerch is on to the correct approach. Try doing the following Guid siteId = SPContext.Current.Site.ID; SPUserToken systemAccountUserToken = SPContext.Current.Site.SystemAccount.UserToken; HttpContext currentUserContext = HttpContext.Current; if (SPContext.Current != null) HttpContext.Current = null; ...


4

Try to delete the current httpcontext before elevating (but do not forget to remember it and set it back like var storedContext = HttpContext.Current; HttpContext.Current = null; <Do something> HttpContext.Current = storedContext; Because it seems to use still your curentUsers Credentials when calling the search service (which it still does in ...


4

You can use set AuthenticationRestrictions="AuthenticatedUsersOnly" Example: <SharePoint:SPSecurityTrimmedControl runat="server" AuthenticationRestrictions="AuthenticatedUsersOnly"> .... </SharePoint:SPSecurityTrimmedControl> Reference: http://sharepoint-community.net/profiles/blogs/hide-elements-in-sharepoint-for-anonymous-users-using


4

1.Users can search for SharePoint Items (Documents, Tasks, and Events etc.) Thats a standard functionality. 2.Users can search for SalesForce Items (Chatter Discussions, Documents etc.) You could go with a federated search that would display results in the same way as e.g. Google presents its ads on the right side of the result page. A second way ...


4

The client object model uses the standard SharePoint security and don't allow you to run with elevated priviledges. Who has access to see members of groups are defined at the group and the default is only members can see who are members. You can change this by going to: Site Actions -> Site Settings -> People and groups -> Click the Groups header in ...


4

IfHasRights checks the permissions based on the following permission set: private SPBasePermissions CurrentPermissions() { if (base.wp is DataFormWebPart) { DataFormWebPart wp = base.wp as DataFormWebPart; if (wp.ListItem != null) { return wp.ListItem.EffectiveBasePermissions; } if (wp.SPList != ...


4

Create the links using a "Content Editor Web Part" and assign "Target Audiences" to that web part. So that the links can be targeted to appear only to people who are members of a particular SharePoint group or audience. Reference Links: http://msdn.microsoft.com/en-us/library/ee906649(v=office.14).aspx ...


3

In SharePoint 2013 it is not possible to build a security trimmed managed metadata navigation. I hope this feature will coming soon with a Cumulative Update or Service Pack. I am the owner of the german blog wich was mentioned here. I think i will provide my article in english too. Sorry for that!!


3

Use the following code: using(SPSite site = new SPSite("http://example/site/")) { using (SPWeb web = site.OpenWeb()) { SPWebCollection webCollection = web.GetSubwebsForCurrentUser(); foreach (SPWeb web in webCollection) { if (web.Properties["SiteCategory"] == "SomeCategory1") {} ...


3

The read permission allows user to "View pages, list items and download documents. But on publishing sites (guessing from your screen shot) the restricted read is the permission to be used. The restricted read permission level allows users to "View pages and documents. For publishing sites only". The view only permission is supposed to block users from ...


3

If you have to show/hide parts of the Ribbon based on permissions then SPSecurityTrimmedControl is the ideal way to do it even if you are on SP 2013. You can use ViewListItems permissions to hide the Ribbon from users with Read Only permissions. See this http://msdn.microsoft.com/EN-US/library/ms412690 for all possible types of Permissions which can be used. ...


2

I just came across this post from Waldek that might be useful for you.


2

In sharepoint 2013, you have device channels which exactly do the same thing you need. Device Channels is a mechanism that allows you to define a number of channels, map them to devices using user agent matches or custom logic, and associate different Master Pages to each channel. For more details on this check below links: Device Channel in SP 2013 ...


2

You can extend the SPSecurityTrimmedControl class to create a custom control that discriminates based on group membership rather than permission level. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint.WebControls; using System.Web.UI; using Microsoft.SharePoint; namespace My.Custom.Controls { ...


2

I don't think there's a general approach to do this, but depending on your exact needs there might be a solution. I can think of a few options: Create a list to hold the HTML nodes and apply audience targeting to the individual list items. This way, the user could execute a clientside request to the list to pull back all nodes but they'd only receive nodes ...


2

Site owner can not view site from Viewer's angle. Your given permission must be appeared whenever you login in a site. When I test permission in sites, I used to create several users like Editor, Reader, Admin and so on.


2

You can either place your links as hyperlinks in a Content Editor web part or you can use the Summary Links web part and place that web part on your page. Then "Edit Web part" >> Advanced >> Target Audience >> Add or Select your Group.


2

So you are using a Web Service with the DVWP because you are pulling items from a SharePoint list that exists in a separate site collection? Is the site collection located in the same Farm/Web Application, etc? The security trimming is not related to the DFWP, but the data connection provider you are binding to, and its related ability to impersonate the ...


2

I realize this is a very old thread but I just wanted to add one more possible reason which I found. In my case, I found compiled audiences did not update because the User Profile Service Application (UPS) Permissions contained old Managed Service Accounts which had been deleted from SharePoint and from AD, but were still registered with full control over ...


2

You can download this document Best practices for using fine-grained permissions (SharePoint Products and Technologies): http://www.microsoft.com/en-us/download/details.aspx?id=9030 T.s


2

Out of the box, you can manually enter a user/group to see what their level of access is on a library/list. Under The Library/List > Permissions > Check Permissions in the ribbon. From here, you'll enter a username/group. Actually, you can see a full list of everyone's access on the Permissions page.


2

Don't give the editor Design pemissions or ensure the permissions being used by that group do not have these options checked.


2

The SharePoint 2010 search index, while crawling, collects and stores the information about access control list (ACL) defined for the files or documents. While searching, this information is being used by the search service to security trim the results and so the search results are displayed according to user permissions. Since WSS 2.0 does not support ...


2

Custom security trimmers can be used for additional trimming, it doesn't replace the OOTB security trimmer. As far as I know you can't replace the OOTB security trimmer.


2

You could use different scenarios : Apply security on a series of list depending on the AD Group they are in Apply "By Item" security on a single list by adding an event handler by code, and with some logic, apply the good group to the item Adding a column that would be the department, and filter the list by that column Using this solution to edit the ...


2

using code you can do the same thing but you will have to manipulate multiple objects PluggableSecurityTrimmerManager as you know and then CrawlRule using this CrawlRule object, you can do things like SearchAdmin.CrawlRule crawlRule = content.CrawlRules.Create(SearchAdmin.CrawlRuleType.InclusionRule, "yourRulePath"); ...


2

You could do this by editing the master page; find the SharePoint:SiteActions tag,, inside it you will find <SharePoint:MenuItemTemplate runat="server" id="MenuItem_ViewAllSiteContents",, change PermissionsString="" property to: ...


1

Here are the steps if you want to do it without changing code. Click on "Site Actions -> Site Permissions" On the ribbon select the "Permission Tools" tab and press the "Permission Levels" button under the "Manage" group on the far right Click on the "Read" Permission Level Scroll down to the "Personal Permissions" section and check the box for "Manage ...


1

I'm assuming by relevant sites, you are referring to sites the user has access to. If this is the case, you can create a data view web part based on search results that displays only sites (and not documents/lists/etc.). @WonderLaura has an example/walk-through of how to create such a web part on her blog. This often works best if you use a scoped query ...



Only top voted, non community-wiki answers of a minimum length are eligible