diff options
Diffstat (limited to 'Digitigrade/Policy.php')
| -rw-r--r-- | Digitigrade/Policy.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Digitigrade/Policy.php b/Digitigrade/Policy.php index 56fbdb0..973c229 100644 --- a/Digitigrade/Policy.php +++ b/Digitigrade/Policy.php @@ -2,6 +2,7 @@ namespace Digitigrade; use Digitigrade\Model\Actor; +use Digitigrade\Model\Instance; use Digitigrade\Model\Interaction; use Digitigrade\Model\Note; @@ -34,4 +35,39 @@ abstract class Policy { } // TODO: public function checkExtension() + + /** + * Checks if an Actor is allowed to be federated to a certain Instance, + * and possibly alters it. + * @param Actor $actor the actor 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 checkActorFederation(Actor $actor, ?Instance $instance): bool { + return true; + } + + /** + * Checks if an Interaction is allowed to be federated to a certain Instance, + * and possibly alters it. + * @param Interaction $interaction the interaction 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 checkInteractionFederation(Interaction $interaction, ?Instance $instance): bool { + return true; + } + + /** + * Checks if an 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) + * @return bool true if allowed, false if the request should be cancelled + */ + public function checkNoteFederation(Note $note, ?Instance $instance): bool { + return true; + } + + // TODO: public function checkExtensionFederation() }
\ No newline at end of file |
