diff options
Diffstat (limited to 'Digitigrade/Policy.php')
| -rw-r--r-- | Digitigrade/Policy.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Digitigrade/Policy.php b/Digitigrade/Policy.php new file mode 100644 index 0000000..56fbdb0 --- /dev/null +++ b/Digitigrade/Policy.php @@ -0,0 +1,37 @@ +<?php +namespace Digitigrade; + +use Digitigrade\Model\Actor; +use Digitigrade\Model\Interaction; +use Digitigrade\Model\Note; + +abstract class Policy { + /** + * Checks if an Actor is allowed and possibly alters it. + * @param Actor $actor the actor to check (may be modified in-place) + * @return bool true if allowed, false if the actor should be dropped + */ + public function checkActor(Actor $actor): bool { + return true; + } + + /** + * Checks if an Interaction is allowed and possibly alters it. + * @param Interaction $interaction the interaction to check (may be modified in-place) + * @return bool true if allowed, false if the interaction should be dropped + */ + public function checkInteraction(Interaction $interaction): bool { + return true; + } + + /** + * Checks if a Note is allowed and possibly alters it. + * @param Note $note the note to check (may be modified in-place) + * @return bool true if allowed, false if the note should be dropped + */ + public function checkNote(Note $note): bool { + return true; + } + + // TODO: public function checkExtension() +}
\ No newline at end of file |
