Versions Compared

Key

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

Introduction

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

CoreIdentitiesByValidEmploymentFilter (Version >= 8)

This filter gives access to core identities that have valid employment for the organization unit in the assignment context or its children.

...

Code Block
new CoreIdentitiesByValidEmploymentFilter(null);
new CoreIdentitiesByValidEmploymentFilter(5u);

The first parameter depth is a nullable uint, with the depth you can set how deep in the organization unit tree, the filter should check for active employments.

Code Block
{
  "$type": "iTsense.Moving.Backend.Services.DmcoreService.CoreIdentity.Security.Filter.CoreIdentitiesByValidEmploymentFilter, iTsense.Moving.Backend.Services.DmcoreService",
  "MaxDepth": null,
  "NotContains": false,
  "PropertyChain": {
    "$type": "System.String[], mscorlib",
    "$values": [
      "CoreIdentityEmployments"
    ]
  },
  "SubPropertyChain": {
    "$type": "System.String[], mscorlib",
    "$values": [
      "OrganizationUnit",
      "Id"
    ]
  }
}
languagec#
/// <param name="maxDepth">Defines how deep down into the organization unit path should be searched</param>
CoreIdentitiesByValidEmploymentFilter(uint? maxDepth) 

Example:

Code Block
languagec#
new CoreIdentitiesByValidEmploymentFilter(null);
new CoreIdentitiesByValidEmploymentFilter(5u);

CoreIdentityAttributeValueFilter

This filter will give you access to entity only if you have valid assignment

Code Block
new GenericMyValidAssignmentFilter<ICatalogToRoleAssignment, IRoleAssignment>(n => n.Role.RoleAssignments, n => n.CoreIdentity.Id)

The first generic is the type you want to give access.

The second generic is the type with assignments

The first parameter the chain to the assignment collection

The second parameter the chain core identity id property from assignment

Code Block
{
  "$type": "iTsense.Moving.Backend.Services.DmcoreService.CoreIdentity.Security.Filter.GenericMyValidAssignmentFilter`2[[iTsense.Moving.Backend.Services.DmcoreService.DataInterfaces.Servicedmcore.ICatalogToRoleAssignment, iTsense.Moving.Backend.Services.DmcoreService],[iTsense.Moving.Backend.Services.DmcoreService.DataInterfaces.Servicedmcore.IRoleAssignment, iTsense.Moving.Backend.Services.DmcoreService]], iTsense.Moving.Backend.Services.DmcoreService",
  "NotContains": false,
  "PropertyChain": {
    "$type": "System.String[], mscorlib",
    "$values": [
      "Role",
      "RoleAssignments"
    ]
  },
  "SubPropertyChain": {
    "$type": "System.String[], mscorlib",
    "$values": [
      "CoreIdentity",
      "Id"
    ]
  }
}

CoreIdentityValidAssignmentFilter

This filter will give you access to a core identity only when a valid role or resource assignment is present

Code Block
new CoreIdentityValidAssignmentFilter<IResourceAssignment, uint>(c => c.ResourceAssignments, r => r.Resource.Id, 1)

The first generic is the type of the assignment to check

The second generic is the filter type to filter the assignments

The first parameter the chain to the assignment collection

The second parameter the chain to the filter for the assignment

The third parameter is the filter values that have to macht for the assignments

Code Block
{
  "$type": "iTsense.Moving.Backend.Services.DmcoreService.CoreIdentity.Security.Filter.CoreIdentityValidAssignmentFilter`2[[iTsense.Moving.Backend.Services.DmcoreService.DataInterfaces.Servicedmcore.IResourceAssignment, iTsense.Moving.Backend.Services.DmcoreService],[System.UInt32, mscorlib]], iTsense.Moving.Backend.Services.DmcoreService",
  "FilterValue": 1,
  "NotContains": false,
  "PropertyChain": {
    "$type": "System.String[], mscorlib",
    "$values": [
      "ResourceAssignments"
    ]
  },
  "SubPropertyChain": {
    "$type": "System.String[], mscorlib",
    "$values": [
      "Resource",
      "Id"
    ]
  }
}

CoreIdentityAttributeValueFilter

This filter will give you access to a core identity only when the core identity has an attribute value that matches the filter

...

a core identity only when the core identity has an attribute value that matches the filter

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>
CoreIdentityAttributeValueFilter<TFilterPropertyType> (Expression<Func<ICoreIdentityAttributeValue, TFilterPropertyType>> subPropertyChain, TFilterPropertyType filterValue, StringFilterBehaviour attributeValueFilterBehaviour, string attributeValueFilterValue, string attributeValueType)

Example:

Code Block
languagec#
new CoreIdentityAttributeValueFilter<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

...

CoreIdentityValidAssignmentFilter

This filter will give you access to a core identity only when a valid role or resource assignment is present

Code Block
languagec#
/// <typeparam name="TDtoCollectionObject">The assignment type you want to use</typeparam>
/// <typeparam name="TFilterPropertyType">The filter type you want to use</typeparam>
/// <param name="propertyChain">The path to the assignment collection</param>
/// <param name="subPropertyChain">The path to the property to filter the assignments</param>
/// <param name="filterValue">The value to filter the assignments</param>
CoreIdentityValidAssignmentFilter<TDtoCollectionObject, TFilterPropertyType>(Expression<Func<ICoreIdentity, IEnumerable<TDtoCollectionObject>>> propertyChain, Expression<Func<TDtoCollectionObject, TFilterPropertyType>> subPropertyChain, TFilterPropertyType filterValue) 

Example:

Code Block
languagec#
new CoreIdentityValidAssignmentFilter<IResourceAssignment, uint>(c => c.ResourceAssignments, r => r.Resource.Id, 1)