Exemplo n.º 1
0
 /// <summary>Filters an item by access which returning null if the item is not accessible to the current user.</summary>
 /// <typeparam name="T">Generic argument to allow strongly typed returns.</typeparam>
 /// <param name="item">The item to filter.</param>
 /// <param name="user">The user to filter access for.</param>
 /// <returns>The item if it's accessible to the current user.</returns>
 public static T FilterByAccess <T>(this T item, IPrincipal user) where T : ContentItem
 {
     return(item.FilterWith(new AccessFilter(user, AccessFilter.CurrentSecurityManager())));
 }