aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/Policy.php
diff options
context:
space:
mode:
authorwinter2025-05-07 19:37:08 +0100
committerwinter2025-05-07 19:37:08 +0100
commita904294db09ccaa93a5b561e7cd177026010e601 (patch)
treee491028843b02fdbd5f647ea5b49adee2965ad7a /Digitigrade/Policy.php
parent33a7ad8a141c65841267dc94cc5e5c5be109e03c (diff)
implement extension objects at a basic level
Diffstat (limited to 'Digitigrade/Policy.php')
-rw-r--r--Digitigrade/Policy.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/Digitigrade/Policy.php b/Digitigrade/Policy.php
index 973c229..f5ecbfb 100644
--- a/Digitigrade/Policy.php
+++ b/Digitigrade/Policy.php
@@ -2,6 +2,7 @@
namespace Digitigrade;
use Digitigrade\Model\Actor;
+use Digitigrade\Model\ExtensionObject;
use Digitigrade\Model\Instance;
use Digitigrade\Model\Interaction;
use Digitigrade\Model\Note;
@@ -34,7 +35,14 @@ abstract class Policy {
return true;
}
- // TODO: public function checkExtension()
+ /**
+ * Checks if an ExtensionObject is allowed and possibly alters it.
+ * @param ExtensionObject $extension the extension to check (may be modified in-place)
+ * @return bool true if allowed, false if the extension should be dropped
+ */
+ public function checkExtension(ExtensionObject $extension): bool {
+ return true;
+ }
/**
* Checks if an Actor is allowed to be federated to a certain Instance,
@@ -59,7 +67,7 @@ abstract class Policy {
}
/**
- * Checks if an Note is allowed to be federated to a certain Instance,
+ * Checks if a Note is allowed to be federated to a certain Instance,
* and possibly alters it.
* @param Note $note the note to check (may be modified in-place)
* @param ?Instance $instance the instance that is receiving this (may be null if unknown)
@@ -69,5 +77,14 @@ abstract class Policy {
return true;
}
- // TODO: public function checkExtensionFederation()
+ /**
+ * Checks if an ExtensionObject is allowed to be federated to a certain Instance,
+ * and possibly alters it.
+ * @param ExtensionObject $extension the extension to check (may be modified in-place)
+ * @param ?Instance $instance the instance that is receiving this (may be null if unknown)
+ * @return bool true if allowed, false if the request should be cancelled
+ */
+ public function checkExtensionFederation(ExtensionObject $extension, ?Instance $instance): bool {
+ return true;
+ }
} \ No newline at end of file