diff options
| author | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
|---|---|---|
| committer | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
| commit | 4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch) | |
| tree | 5c07151ae61276d334e88f6309c30d439a85c12e /lib/classes/calendar/Owner.php | |
| parent | da0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff) | |
| parent | 97a188592c679890a25c37ab78463add76a52ff7 (diff) | |
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'lib/classes/calendar/Owner.php')
| -rw-r--r-- | lib/classes/calendar/Owner.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/classes/calendar/Owner.php b/lib/classes/calendar/Owner.php new file mode 100644 index 0000000..a7c2519 --- /dev/null +++ b/lib/classes/calendar/Owner.php @@ -0,0 +1,40 @@ +<?php + +namespace Studip\Calendar; + +/** + * The Studip\Calendar\Owner interface defines methods that classes whose instances own calendars + * shall implement to faciliate permission checks for that calendars. + */ +interface Owner +{ + /** + * Retrieves the Owner object for a specified owner-ID. + * + * @param string $owner_id The ID of the owner. + * + * @return Owner|null Either the Owner object if it can be found or null in case + * it cannot be found. + */ + public static function getCalendarOwner(string $owner_id) : ?Owner; + + /** + * Determines whether the specified user has read permissions to the calendar. + * + * @param string|null $user_id The ID of the user for which to determine write permissions. + * Defaults to the current user if no user-ID is provided. + * + * @return bool True, if the user has read permissions, false otherwise. + */ + public function isCalendarReadable(?string $user_id = null) : bool; + + /** + * Determines whether the specified user has write permissions to the calendar. + * + * @param string|null $user_id The ID of the user for which to determine write permissions. + * Defaults to the current user if no user-ID is provided. + * + * @return bool True, if the user has write permissions, false otherwise. + */ + public function isCalendarWritable(?string $user_id = null) : bool; +} |
