Permissions
Participant permissions are specified during Media DCR creation and dictate how participants can interact with the Media DCR. The permissions system has several important rules and constraints that must be followed when configuring participant groups.
Available permissions
VIEW_OVERLAP- Allows participants to view the overlap statistics
 
VIEW_INSIGHTS- Allows participants to view insights derived from the combination of first-party data
 - Requirements:
- The DCR must have insights enabled
 - At least one participant in the DCR must have this permission if insights are enabled
 
 
PROVIDE_SEED_AUDIENCE- Allows participants to upload a seed audience dataset
 - Requirements:
- Only one participant in the DCR can have this permission
 - The participant with this permission cannot also have the 
PROVIDE_BASE_AUDIENCEpermission 
 
PROVIDE_BASE_AUDIENCE- Allows participants to provision a Datalab to the Media DCR
 - Requirements:
- Only one participant in the DCR can have this permission
 - The participant with this permission cannot also have the 
PROVIDE_SEED_AUDIENCEpermission 
 
CREATE_CUSTOM_AUDIENCE- Allows participants to create lookalike, remarketing or rule-based audiences
 - Requirements:
- At least one of these collaboration types must be enabled in the DCR:
- Rule-based
 - Lookalike
 - Remarketing audiences
 
 - If any of these collaboration types are enabled, at least one participant must have this permission
 
 - At least one of these collaboration types must be enabled in the DCR:
 
EXPORT_AUDIENCE- Allows participants to export audiences that are available to them
 - Requirements:
- At least one of these collaboration types must be enabled in the DCR:
- Rule-based
 - AI Lookalike
 - Remarketing audiences
 
 - If any of these collaboration types are enabled, at least one participant must have this permission
 
 - At least one of these collaboration types must be enabled in the DCR:
 
General requirements
The DCR must enable at least one collaboration type:
- Insights
 - Remarketing audiences
 - AI Lookalike audiences
 - Rule-based audiences
 
When audience features are enabled (remarketing, rule-based, or lookalike):
- At least one participant must have 
CREATE_CUSTOM_AUDIENCEpermission - At least one participant must have 
EXPORT_AUDIENCEpermission 
- At least one participant must have 
 When insights are enabled:
- At least one participant must have 
VIEW_INSIGHTSpermission 
- At least one participant must have 
 
Example configuration
Here's an example of a valid permission configuration for a Media DCR with multiple participant groups:
from decentriq_platform.media import Participant, Permission
participant_groups = [
    Participant(
        id="publisher",
        role="Publisher",
        permissions=[
            Permission.VIEW_OVERLAP,
            Permission.VIEW_INSIGHTS,
            Permission.PROVIDE_BASE_AUDIENCE,
            Permission.EXPORT_AUDIENCE
        ],
        emails=["publisher@example.com"]
    ),
    Participant(
        id="advertiser",
        role="Advertiser",
        permissions=[
            Permission.VIEW_OVERLAP,
            Permission.VIEW_INSIGHTS,
            Permission.CREATE_CUSTOM_AUDIENCE,
            Permission.PROVIDE_SEED_AUDIENCE
        ],
        emails=["advertiser@example.com"]
    )
]