...
Code Block |
---|
|
new GenericContextCollectionPropertyChainFilter<IEventHandler, IEventSubscription>(e => e.EventSubscriptions, new ContextPropertyFilter<IEventSubscription>(new[]
{
new ContextPropertyFilterDefintion<IEventSubscription>(e => e.EventHandler.Id, CoreLoginAssignmentContextTypes.OrganizationUnit),
new ContextPropertyFilterDefintion<IEventSubscription>(e => e.Id, CoreLoginAssignmentContextTypes.User)
})); |
Assignment
GenericMyValidAssignmentFilter (Version >= 8)
This filter will give you access to the entity only if you have a valid assignment.
Code Block |
---|
/// <typeparam name="TDtoType">The interface type of the db entity this security filter should be applied to</typeparam>
/// <typeparam name="TDtoCollectionObject">The type of assignment you want to use</typeparam>
/// <param name="propertyChain">The path from TDtoType to the collection of TDtoCollectionObject</param>
/// <param name="subPropertyChain">The path to the property you want to check against the current core identity id</param>
GenericMyValidAssignmentFilter<TDtoType, TDtoCollectionObject> (Expression<Func<TDtoType, IEnumerable<TDtoCollectionObject>>> propertyChain, Expression<Func<TDtoCollectionObject, uint>> subPropertyChain) |
Example:
Code Block |
---|
new GenericMyValidAssignmentFilter<ICatalogToRoleAssignment, IRoleAssignment>(n => n.Role.RoleAssignments, n => n.CoreIdentity.Id) |