glasswall.content_management.policies.editor
1from typing import Optional 2 3from glasswall.content_management.policies.policy import Policy 4 5 6class Editor(Policy): 7 """ A content management policy for Editor. 8 9 When used with the Editor library's set_content_management_policy, the engine's 10 default policy settings are queried via GW2GetPolicySettings. If 'default' is 11 specified, it is applied to all content switches. Any explicit overrides from 12 'config' are applied on top. If 'default' is None, the engine's own default 13 values are used unmodified. 14 15 Args: 16 default (Optional[str]): Default None. The value to set all content switches to 17 (e.g. "sanitise", "allow", "disallow"). If None, the engine's own default 18 values are used unmodified. 19 config (dict): Explicit overrides for specific config elements and switches. 20 e.g. {"pdfConfig": {"metadata": "allow"}} 21 """ 22 23 def __init__(self, default: Optional[str] = None, config: dict = {}): 24 self.default = default 25 self.config = config or {} 26 self.config_elements = []
8class Editor(Policy): 9 """ A content management policy for Editor. 10 11 When used with the Editor library's set_content_management_policy, the engine's 12 default policy settings are queried via GW2GetPolicySettings. If 'default' is 13 specified, it is applied to all content switches. Any explicit overrides from 14 'config' are applied on top. If 'default' is None, the engine's own default 15 values are used unmodified. 16 17 Args: 18 default (Optional[str]): Default None. The value to set all content switches to 19 (e.g. "sanitise", "allow", "disallow"). If None, the engine's own default 20 values are used unmodified. 21 config (dict): Explicit overrides for specific config elements and switches. 22 e.g. {"pdfConfig": {"metadata": "allow"}} 23 """ 24 25 def __init__(self, default: Optional[str] = None, config: dict = {}): 26 self.default = default 27 self.config = config or {} 28 self.config_elements = []
A content management policy for Editor.
When used with the Editor library's set_content_management_policy, the engine's default policy settings are queried via GW2GetPolicySettings. If 'default' is specified, it is applied to all content switches. Any explicit overrides from 'config' are applied on top. If 'default' is None, the engine's own default values are used unmodified.
Args: default (Optional[str]): Default None. The value to set all content switches to (e.g. "sanitise", "allow", "disallow"). If None, the engine's own default values are used unmodified. config (dict): Explicit overrides for specific config elements and switches. e.g. {"pdfConfig": {"metadata": "allow"}}