/// <summary> /// Fires the <see cref="SecurityCacheProviderInstrumentationProvider.securityCacheReadPerformed"/> event. /// </summary> /// <param name="itemType">The type of item that is read from the <see cref="SecurityCacheProvider"/>.</param> /// <param name="token">The token that was is used to read an item from the <see cref="SecurityCacheProvider"/>.</param> public void FireSecurityCacheReadPerformed(SecurityEntityType itemType, IToken token) { if (securityCacheReadPerformed != null) { securityCacheReadPerformed(this, new SecurityCacheOperationEventArgs(itemType, token)); } }
/// <summary> /// </summary> /// <param name="itemType">The type of item that is read from the <see cref="SecurityCacheProvider"/>.</param> /// <param name="token">The token that was is used to read an item from the <see cref="SecurityCacheProvider"/>.</param> public void FireSecurityCacheReadPerformed(SecurityEntityType itemType, IToken token) { if (PerformanceCountersEnabled) { securityCacheReadPerformedCounter.Increment(); totalSecurityCacheReadPerformedCounter.Increment(); } }
private void ExpireSecurityCacheItem(IToken token, SecurityEntityType entityType) { SecurityCacheItem item = GetSecurityCacheItem(token); if (item != null) { ClearCachItemEntity(item, entityType); if (item.IsRemoveable) { securityCacheManager.Remove(token.Value); } } }
private void ClearCachItemEntity(SecurityCacheItem item, SecurityEntityType entityType) { switch (entityType) { case SecurityEntityType.Identity: item.Identity = null; break; case SecurityEntityType.Principal: item.Principal = null; break; case SecurityEntityType.Profile: item.Profile = null; break; } }
/// <summary> /// Initializes a new instance of the <see cref="SecurityCacheOperationEventArgs"/> class. /// </summary> /// <param name="itemType">The type of item this cache operation applies to.</param> /// <param name="token">The token used on this cache operation.</param> public SecurityCacheOperationEventArgs(SecurityEntityType itemType, IToken token) { this.token = token; this.itemType = itemType; }
private static IEnumerable <string> SecurityEntityWithReadAccess(this IContentSecurable contentSecurable, SecurityEntityType securityEntityType) { ObjectExtensions.ValidateNotNullArgument((object)contentSecurable, "contentSecurable"); return((IEnumerable <string>)Enumerable.ToArray <string>(Enumerable.Select <AccessControlEntry, string>(Enumerable.Where <AccessControlEntry>(contentSecurable.GetContentSecurityDescriptor().Entries, (Func <AccessControlEntry, bool>)(x => { if (x.EntityType == securityEntityType) { return (x.Access & AccessLevel.Read) == AccessLevel.Read; } else { return false; } })), (Func <AccessControlEntry, string>)(x => x.Name)))); }
/// <summary /> public void FireSecurityCacheReadPerformed(SecurityEntityType itemType, IToken token) { }
/// <summary> /// Fires the <see cref="SecurityCacheProviderInstrumentationProvider.securityCacheReadPerformed"/> event. /// </summary> /// <param name="itemType">The type of item that is read from the <see cref="SecurityCacheProvider"/>.</param> /// <param name="token">The token that was is used to read an item from the <see cref="SecurityCacheProvider"/>.</param> public void FireSecurityCacheReadPerformed(SecurityEntityType itemType, IToken token) { if (securityCacheReadPerformed != null) securityCacheReadPerformed(this, new SecurityCacheOperationEventArgs(itemType, token)); }
public virtual void ClearAclForMembership(String userOrRoleName, SecurityEntityType securityEntityType) { UnifiedPathInfo.ClearAclForMembership(userOrRoleName, securityEntityType); }