diff options
Diffstat (limited to 'Digitigrade/Policy.php')
| -rw-r--r-- | Digitigrade/Policy.php | 23 |
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 |
