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 |
str
|
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
319 320 321 322 | |
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.
Calls route
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | |
get_active_policies ¶
get_active_policies() -> list[PDPPolicy]
Get all currently active policies.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
351 352 353 | |
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
332 333 334 335 336 337 338 339 340 341 | |
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
343 344 345 346 347 348 349 | |
remove_policy ¶
remove_policy(policy_id: str) -> None
Remove a policy from this dataset.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
324 325 326 327 328 329 330 | |
PDPOperator ¶
PDPParameterType ¶
PDPPolicy
dataclass
¶
PDPPolicy(
auth: DomoAuth,
id: str,
raw: dict,
name: str | None = None,
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 |
name |
str | None
|
Display name of the policy |
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 |
display_url
property
¶
display_url: str
Dataset overview page for the policy's dataset (unverified approximation; Domo has no per-policy page we confirmed).
add_parameter ¶
add_parameter(parameter: PdpParameter) -> None
Add a filter parameter to this policy.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
208 209 210 211 | |
from_api_dict
classmethod
¶
Create policy from API response data.
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 | |
from_dict
classmethod
¶
Build a policy from a filter-group API object, bound to auth.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
170 171 172 173 | |
get_by_id
async
classmethod
¶
get_by_id(
auth: DomoAuth,
dataset_id: str,
policy_id: str,
*,
context: RouteContext | None = None,
**context_kwargs,
) -> PDPPolicy
Fetch one policy of a dataset (Domo has no single-policy route, so list and match).
Calls route
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
get_entity_by_id
async
classmethod
¶
get_entity_by_id(
auth: DomoAuth,
entity_id: str,
*,
dataset_id: str,
**kwargs,
)
A policy lives on a dataset, so dataset_id is required.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
199 200 201 202 203 204 205 206 | |
is_active ¶
is_active() -> bool
Check if the policy is currently active and effective.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
217 218 219 220 221 222 223 224 225 226 227 | |
refresh
async
¶
refresh(**kwargs)
Refresh this policy; a policy is addressed by dataset and policy ID, so pass the dataset ID.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
166 167 168 | |
remove_parameter ¶
remove_parameter(parameter_id: str) -> None
Remove a parameter from this policy.
Source code in src/crew_dcs/classes/DomoDataset/pdp.py
213 214 215 | |
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
252 253 254 255 256 257 258 259 260 261 262 263 264 | |
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
109 110 111 112 113 114 115 116 117 118 119 | |
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
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |