| @@ -19,14 +19,11 @@ | ||
| 19 | 19 | return self::$restricted; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * Assert the current user can read/write $ticket. | |
| 23 | + * Check the current user can access $ticket, including mailbox restrictions. | |
| 24 | + * Returns WP_Error on failure, null on success: | |
| 24 | 25 | * |
| 25 | - * Checks both the canAccessTicket visibility rule and any mailbox | |
| 26 | - * restrictions the agent has been assigned. Returns WP_Error on the first | |
| 27 | - * failure, null on success — so callers do: | |
| 28 | - * | |
| 29 | 26 | * if ($err = TicketAccessGuard::assert($ticket)) { |
| 30 | 27 | * return $err; |
| 31 | 28 | * } |
| 32 | 29 | */ |
| @@ -44,9 +41,9 @@ | ||
| 44 | 41 | return null; |
| 45 | 42 | } |
| 46 | 43 | |
| 47 | 44 | /** |
| 48 | - * Assert the current user can create tickets in / move tickets to $mailboxId. | |
| 45 | + * Check the current user can create or move tickets in $mailboxId. | |
| 49 | 46 | * Returns WP_Error on failure, null on success. |
| 50 | 47 | */ |
| 51 | 48 | public static function assertMailboxWritable($mailboxId) |
| 52 | 49 | { |
| @@ -57,9 +54,9 @@ | ||
| 57 | 54 | return null; |
| 58 | 55 | } |
| 59 | 56 | |
| 60 | 57 | /** |
| 61 | - * Assert that $targetAgent is not restricted from the mailbox of $ticket. | |
| 58 | + * Check $targetAgent isn't restricted from the ticket's mailbox. | |
| 62 | 59 | * Returns WP_Error on failure, null on success. |
| 63 | 60 | * |
| 64 | 61 | * @param int|null $mailboxId Destination mailbox when the ticket is being |
| 65 | 62 | * moved; null checks the one it sits in now. |