From 4d6b089b3e11812e736b0199b0cbf021ea284f74 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 11 Jan 2024 11:19:34 +0800 Subject: [PATCH] Add extension points for permissions. --- cookiecutter.json | 7 +++++-- {{ cookiecutter.format }}/Entitlements.plist | 10 ++++++---- .../Contents/Info.plist | 6 ++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 53eaf65..0a5f28c 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -3,12 +3,15 @@ "formal_name": "App Name", "app_name": "{{ cookiecutter.formal_name|lower|replace(' ', '-') }}", "module_name": "{{ cookiecutter.app_name|replace('-', '_') }}", + "permissions": "", + "entitlements": "", + "document_types": "", "version": "1.0.0", "build": "1", "bundle": "com.example", - "document_types": {}, "python_version": "3.X.0", "_extensions": [ - "briefcase.integrations.cookiecutter.PythonVersionExtension" + "briefcase.integrations.cookiecutter.PythonVersionExtension", + "briefcase.integrations.cookiecutter.PListExtension" ] } diff --git a/{{ cookiecutter.format }}/Entitlements.plist b/{{ cookiecutter.format }}/Entitlements.plist index 7cd9df0..d7d79ec 100644 --- a/{{ cookiecutter.format }}/Entitlements.plist +++ b/{{ cookiecutter.format }}/Entitlements.plist @@ -2,9 +2,11 @@ - com.apple.security.cs.allow-unsigned-executable-memory - - com.apple.security.cs.disable-library-validation - +{%- if cookiecutter.entitlements -%} + {%- for entitlement, value in cookiecutter.entitlements.items() %} + {{ entitlement }} + {{ value|plist_value }} + {%- endfor -%} +{%- endif %} diff --git a/{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}.app/Contents/Info.plist b/{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}.app/Contents/Info.plist index 3ba5049..d513664 100644 --- a/{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}.app/Contents/Info.plist +++ b/{{ cookiecutter.format }}/{{ cookiecutter.formal_name }}.app/Contents/Info.plist @@ -79,5 +79,11 @@ {% endfor %} {% endif %} +{%- if cookiecutter.permissions -%} + {%- for permission, value in cookiecutter.permissions.items() %} + {{ permission }} + {{ value|plist_value }} + {%- endfor -%} +{%- endif %}