pdp
pdp ¶
PDP (Personalized Data Permissions) system using the unified entities architecture.
This module models PDP policies as entities and parameters. Relationship associations are pending refactor to the new Relationships system.
DatasetPdpPolicies
dataclass
¶
DatasetPdpPolicies(
parent: DomoEntity,
policies: list[PDPPolicy] = list(),
is_pdp_enabled: bool = False,
)
Bases: DomoSubEntity
Manager for all PDP policies associated with a dataset.
This class provides high-level operations for managing the collection of PDP policies that apply to a specific dataset.
Attributes:
| Name | Type | Description |
|---|---|---|
dataset_id |
ID of the dataset these policies apply to |
|
policies |
list[PDPPolicy]
|
list of PDP policies for this dataset |
is_pdp_enabled |
bool
|
Whether PDP is enabled for this dataset |
add_policy ¶
add_policy(policy: PDPPolicy) -> None
Add a policy to this dataset.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
260 261 262 263 | |
get
async
¶
get(
auth: DomoAuth | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
)
Fetch and hydrate PDP policies for this dataset.
Returns the hydrated policy list by default, or raw route response when return_raw=True.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
get_active_policies ¶
get_active_policies() -> list[PDPPolicy]
Get all currently active policies.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
292 293 294 | |
get_policy_by_id ¶
get_policy_by_id(policy_id: str) -> PDPPolicy | None
Get a policy by its ID.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
273 274 275 276 277 278 279 280 281 282 | |
get_policy_by_name ¶
get_policy_by_name(
name: str, exact_match: bool = True
) -> PDPPolicy | None
Get a policy by its name.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
284 285 286 287 288 289 290 | |
remove_policy ¶
remove_policy(policy_id: str) -> None
Remove a policy from this dataset.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
265 266 267 268 269 270 271 | |
PDPOperator ¶
PDPParameterType ¶
PDPPolicy
dataclass
¶
PDPPolicy(
auth: DomoAuth,
id: str,
raw: dict,
dataset_id: str | None = None,
filter_group_id: str | None = None,
parameters: list[PdpParameter] = list(),
policy_status: PDPPolicyStatus | None = ACTIVE,
is_enabled: bool = True,
priority: int = 1,
effective_date: datetime | None = None,
expiration_date: datetime | None = None,
created_by_user_id: str | None = None,
last_modified_by_user_id: str | None = None,
)
Bases: DomoEntity
Represents a PDP (Personalized Data Permissions) policy.
A PDP policy is a rule that applies to a dataset, defining how data should be filtered based on parameters and which users/groups have access.
The policy uses the relationship system to manage user and group associations rather than storing direct lists, providing better tracking and management.
Attributes:
| Name | Type | Description |
|---|---|---|
dataset_id |
str | None
|
ID of the dataset this policy applies to |
filter_group_id |
str | None
|
Domo's internal ID for this policy |
parameters |
list[PdpParameter]
|
list of filter parameters that define the data restrictions |
policy_status |
PDPPolicyStatus | None
|
Current status of the policy (active, inactive, etc.) |
is_enabled |
bool
|
Whether the policy is currently enforced |
priority |
int
|
Priority order when multiple policies apply |
effective_date |
datetime | None
|
When the policy becomes effective |
expiration_date |
datetime | None
|
When the policy expires (if applicable) |
created_by_user_id |
str | None
|
ID of the user who created this policy |
last_modified_by_user_id |
str | None
|
ID of the user who last modified this policy |
add_parameter ¶
add_parameter(parameter: PdpParameter) -> None
Add a filter parameter to this policy.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
158 159 160 161 | |
from_api_dict
classmethod
¶
from_api_dict(data: dict[str, Any]) -> PDPPolicy
Create policy from API response data.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
is_active ¶
is_active() -> bool
Check if the policy is currently active and effective.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
167 168 169 170 171 172 173 174 175 176 177 | |
remove_parameter ¶
remove_parameter(parameter_id: str) -> None
Remove a parameter from this policy.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
163 164 165 | |
to_api_dict ¶
to_api_dict() -> dict[str, Any]
Convert policy to API format for Domo requests.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
198 199 200 201 202 203 204 205 206 207 208 209 210 | |
PDPPolicyStatus ¶
PdpParameter
dataclass
¶
PdpParameter(
parent: DomoEntity,
column_name: str | None = None,
column_values: list[str] = list(),
operator: PDPOperator | None = EQUALS,
parameter_type: PDPParameterType | None = COLUMN,
ignore_case: bool = True,
is_required: bool = True,
description: str | None = None,
trusted_attribute_key: str | None = None,
)
Bases: DomoSubEntity
Represents a single parameter (filter) within a PDP policy.
Each parameter defines a specific filter condition that will be applied to the dataset when users access it through the policy.
Attributes:
| Name | Type | Description |
|---|---|---|
column_name |
str | None
|
The dataset column this parameter filters on |
column_values |
list[str]
|
list of values to filter by |
operator |
PDPOperator | None
|
The comparison operator to use (equals, greater than, etc.) |
parameter_type |
PDPParameterType | None
|
Whether this is a column-based or dynamic filter |
ignore_case |
bool
|
Whether string comparisons should ignore case |
is_required |
bool
|
Whether this parameter must have a value |
description |
str | None
|
Human-readable description of what this parameter does |
trusted_attribute_key |
str | None
|
For dynamic parameters, the trusted attribute to use |
from_api_dict
classmethod
¶
from_api_dict(data: dict[str, Any]) -> PdpParameter
Create parameter from API response data.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
108 109 110 111 112 113 114 115 116 117 118 | |
to_api_dict ¶
to_api_dict() -> dict[str, Any]
Convert parameter to API format for Domo requests.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |