summaryrefslogtreecommitdiff
path: root/doc/plugins.markdown
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-10 18:59:06 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-10 18:59:06 -0400
commit0e233673e32ffff50dd9392fb3c371a9fff8bf0a (patch)
treef7e3b24813c28f122de1b42dcf3784faabb3ae2f /doc/plugins.markdown
parente3521db6a83639b409e2dd7abb19417f3ac0a9cd (diff)
Allow plugins to override CSP rules
Diffstat (limited to 'doc/plugins.markdown')
-rw-r--r--doc/plugins.markdown21
1 files changed, 20 insertions, 1 deletions
diff --git a/doc/plugins.markdown b/doc/plugins.markdown
index 031bf963..9e0a4cfe 100644
--- a/doc/plugins.markdown
+++ b/doc/plugins.markdown
@@ -198,7 +198,7 @@ Example to add new content in the dashboard sidebar:
$this->template->hook->attach('template:dashboard:sidebar', 'myplugin:dashboard/sidebar');
```
-This call is usually defined in the `initialize()` method.
+This call is usually defined in the `initialize()` method.
The first argument is name of the hook and the second argument is the template name.
Template names prefixed with the plugin name and colon indicate the location of the template.
@@ -329,6 +329,25 @@ $this->on('session.bootstrap', function($container) {
The translations must be stored in `plugins/Myplugin/Locale/xx_XX/translations.php`.
+Override HTTP Content Security Policy
+-------------------------------------
+
+If you would like to replace the default HTTP Content Security Policy header, you can use the method `setContentSecurityPolicy()`:
+
+```php
+<?php
+
+namespace Plugin\Csp;
+
+class Plugin extends \Core\Plugin\Base
+{
+ public function initialize()
+ {
+ $this->setContentSecurityPolicy(array('script-src' => 'something'));
+ }
+}
+```
+
Dependency Injection Container
------------------------------