Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
PolicyHandler Class Referenceabstract

This class provides an interface for all policy handler functions on a file. More...

#include <src/api/mip/upe/policy_handler.h>

Public Member Functions

virtual std::vector< std::shared_ptr< Action > > ComputeActions (const ExecutionState &state)=0
 Executes the rules in the handler based on the provided state and returns the list of actions to be executed.
 
virtual std::shared_ptr< ContentLabelGetSensitivityLabel (const ExecutionState &state)=0
 Get the sensitivity label from existing content.
 
virtual void NotifyCommittedActions (const ExecutionState &state)=0
 Called once the computed actions have been applied, and the data committed to disk.
 

Static Public Member Functions

static MIP_API bool __CDECL IsLabeled (const std::vector< MetadataEntry > &metadata, const std::shared_ptr< MipContext > &mipContext)
 Checks whether metadata contains label artifacts.
 
static MIP_API bool __CDECL IsLabeled (const std::vector< MetadataEntry > &metadata, const std::shared_ptr< MipContext > &mipContext, const std::shared_ptr< void > &loggerContext)
 Checks whether metadata contains label artifacts.
 

Detailed Description

This class provides an interface for all policy handler functions on a file.

Definition at line 53 of file policy_handler.h.

Member Function Documentation

◆ ComputeActions()

virtual std::vector< std::shared_ptr< Action > > PolicyHandler::ComputeActions ( const ExecutionState & state)
pure virtual

Executes the rules in the handler based on the provided state and returns the list of actions to be executed.

Parameters
statethe current execution state of the content the rules are running on.
Returns
list of actions that should be applied on the content.

◆ GetSensitivityLabel()

virtual std::shared_ptr< ContentLabel > PolicyHandler::GetSensitivityLabel ( const ExecutionState & state)
pure virtual

Get the sensitivity label from existing content.

Parameters
stateCurrent state of the content.
Returns
the label currently applied to the content. If not labeled, returns empty.

◆ IsLabeled() [1/2]

static MIP_API bool __CDECL PolicyHandler::IsLabeled ( const std::vector< MetadataEntry > & metadata,
const std::shared_ptr< MipContext > & mipContext )
static

Checks whether metadata contains label artifacts.

Parameters
metadataMetadata of file to check
mipContextGlobal MIP context
Returns
True if metadata contains active label artifacts, else false
Note
This will only detect Microsoft labels. It will not detect 3rd-party labels, even if a tenant is configured to translate 3rd-party label metadata to Microsoft labels. The primary purpose of this API is to allow an application to quickly detect labeled content without any HTTP calls, and ths limitation is caused by the fact that retrieving tenant-specific label mapping would require an HTTP call.

◆ IsLabeled() [2/2]

static MIP_API bool __CDECL PolicyHandler::IsLabeled ( const std::vector< MetadataEntry > & metadata,
const std::shared_ptr< MipContext > & mipContext,
const std::shared_ptr< void > & loggerContext )
static

Checks whether metadata contains label artifacts.

Parameters
metadataMetadata of file to check
mipContextGlobal MIP context
loggerContextLogger context that will be opaquely passed to the logger delegate
Returns
True if metadata contains active label artifacts, else false
Note
This will only detect Microsoft labels. It will not detect 3rd-party labels, even if a tenant is configured to translate 3rd-party label metadata to Microsoft labels. The primary purpose of this API is to allow an application to quickly detect labeled content without any HTTP calls, and ths limitation is caused by the fact that retrieving tenant-specific label mapping would require an HTTP call.

◆ NotifyCommittedActions()

virtual void PolicyHandler::NotifyCommittedActions ( const ExecutionState & state)
pure virtual

Called once the computed actions have been applied, and the data committed to disk.

Parameters
statethe current execution state of the content after the actions have been committed.
Note
: This call sends an audit event.

The documentation for this class was generated from the following file: