Skip to content

Commit

Permalink
WIP for iframe permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
beaugunderson committed Feb 7, 2025
1 parent 337de2d commit e821548
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion canvas_sdk/effects/launch_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,24 @@ class TargetType(StrEnum):
NEW_WINDOW = "new_window"
RIGHT_CHART_PANE = "right_chart_pane"

class Permission(StrEnum):
MICROPHONE = "microphone"
ALLOW_CROSS_ORIGIN = "allow-cross-origin"

url: str | None = None
content: str | None = None
target: TargetType = TargetType.DEFAULT_MODAL
permissions: list[Permission] | None = None

@property
def values(self) -> dict[str, Any]:
"""The LaunchModalEffect values."""
return {"url": self.url, "content": self.content, "target": self.target.value}
return {
"url": self.url,
"content": self.content,
"target": self.target.value,
"permissions": self.permissions or [],
}

@model_validator(mode="after")
def check_mutually_exclusive_fields(self) -> Self:
Expand Down

0 comments on commit e821548

Please sign in to comment.