Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

RoleAttributeValueFilter

Twin-brother of CoreIdentityAttributeValueFilter This filter will give you access to a role only when the role has an attribute value that matches the filter

Code Block
new RoleAttributeValueFilter<uint>(c => c.Attribute.Id, 1, StringFilterBehaviour.EndsWith, "li", "string")

The first generic is the type of the attribute id

The first parameter the chain to the attribute id

The second parameter the requested attribute id

The third parameter the requested search beavior

  • Equals - value 0

  • StartsWith - 1

  • EndsWith - 2

  • Contains - 3

The fourth parameter the search value

The fifth parameter the type of the serialized attribute value

...

Introduction

On this site, all the security filters are built to check the security of IRoles.

Filter

RoleAttributeValueFilter

This security filter checks if a role attribute value exists that match the filter and then gives you access to a role entity.

Code Block
languagec#
/// <typeparam name="TFilterPropertyType">The filter type you want to find the correct attribute values</typeparam>
/// <param name="subPropertyChain">Path to the property to filter the possible attribute values</param>
/// <param name="filterValue">The filter to search the attribute values to check</param>
/// <param name="attributeValueFilterBehaviour">Behaviour how to filter the attribute values based on attributeValueFilterValue</param>
/// <param name="attributeValueFilterValue">The filter value you want to apply to the attribute values</param>
/// <param name="attributeValueType">The type how the attribute value is serialized into the database</param>
RoleAttributeValueFilter<TFilterPropertyType> (Expression<Func<IRoleAttributeValue, TFilterPropertyType>> subPropertyChain, TFilterPropertyType filterValue, StringFilterBehaviour attributeValueFilterBehaviour, string attributeValueFilterValue, string attributeValueType) : base(c => c.RoleAttributeValues, subPropertyChain)

Possible filter behaviors:

Code Block
languagec#
  Equals,
  StartsWith,
  EndsWith,
  Contains

Example:

Code Block
languagec#
new RoleAttributeValueFilter<uint>(c => c.Attribute.Id, 1, StringFilterBehaviour.EndsWith, "li", "string")